tfcconnection-zola/.shadow-cljs/builds/app/dev/goog-js/goog.window.window.js

1 line
42 KiB
JavaScript

["^ ","~:resource-id",["~:shadow.build.classpath/resource","goog/window/window.js"],"~:js","goog.provide(\"goog.window\");\ngoog.require(\"goog.dom\");\ngoog.require(\"goog.dom.TagName\");\ngoog.require(\"goog.dom.safe\");\ngoog.require(\"goog.html.SafeUrl\");\ngoog.require(\"goog.html.uncheckedconversions\");\ngoog.require(\"goog.labs.userAgent.platform\");\ngoog.require(\"goog.string\");\ngoog.require(\"goog.string.Const\");\ngoog.require(\"goog.userAgent\");\ngoog.requireType(\"goog.string.TypedString\");\ngoog.window.DEFAULT_POPUP_HEIGHT = 500;\ngoog.window.DEFAULT_POPUP_WIDTH = 690;\ngoog.window.DEFAULT_POPUP_TARGET = \"google_popup\";\ngoog.window.createFakeWindow_ = function() {\n return {};\n};\ngoog.window.open = function(linkRef, opt_options, opt_parentWin) {\n if (!opt_options) {\n opt_options = {};\n }\n var parentWin = opt_parentWin || window;\n var safeLinkRef;\n if (linkRef instanceof goog.html.SafeUrl) {\n safeLinkRef = linkRef;\n } else {\n var url = typeof linkRef.href != \"undefined\" ? linkRef.href : String(linkRef);\n safeLinkRef = goog.html.SafeUrl.sanitize(url);\n }\n const browserSupportsCoop = self.crossOriginIsolated !== undefined;\n let referrerPolicy = \"strict-origin-when-cross-origin\";\n if (window.Request) {\n referrerPolicy = (new Request(\"/\")).referrerPolicy;\n }\n const pageSetsUnsafeReferrerPolicy = referrerPolicy === \"unsafe-url\";\n let noReferrerOption = opt_options[\"noreferrer\"];\n if (browserSupportsCoop && noReferrerOption) {\n if (pageSetsUnsafeReferrerPolicy) {\n throw new Error(\"Cannot use the noreferrer option on a page that sets a referrer-policy of `unsafe-url` in modern browsers!\");\n }\n noReferrerOption = false;\n }\n var target = opt_options.target || linkRef.target;\n var sb = [];\n for (var option in opt_options) {\n switch(option) {\n case \"width\":\n case \"height\":\n case \"top\":\n case \"left\":\n sb.push(option + \"\\x3d\" + opt_options[option]);\n break;\n case \"target\":\n case \"noopener\":\n case \"noreferrer\":\n break;\n default:\n sb.push(option + \"\\x3d\" + (opt_options[option] ? 1 : 0));\n }\n }\n var optionString = sb.join(\",\");\n var newWin;\n if (goog.labs.userAgent.platform.isIos() && parentWin.navigator && parentWin.navigator[\"standalone\"] && target && target != \"_self\") {\n var a = goog.dom.createElement(goog.dom.TagName.A);\n goog.dom.safe.setAnchorHref(a, safeLinkRef);\n a.target = target;\n if (noReferrerOption) {\n a.rel = \"noreferrer\";\n }\n var click = document.createEvent(\"MouseEvent\");\n click.initMouseEvent(\"click\", true, true, parentWin, 1);\n a.dispatchEvent(click);\n newWin = goog.window.createFakeWindow_();\n } else if (noReferrerOption) {\n newWin = goog.dom.safe.openInWindow(\"\", parentWin, target, optionString);\n var sanitizedLinkRef = goog.html.SafeUrl.unwrap(safeLinkRef);\n if (newWin) {\n if (goog.userAgent.EDGE_OR_IE) {\n if (goog.string.contains(sanitizedLinkRef, \";\")) {\n sanitizedLinkRef = \"'\" + sanitizedLinkRef.replace(/'/g, \"%27\") + \"'\";\n }\n }\n newWin.opener = null;\n if (sanitizedLinkRef === \"\") {\n sanitizedLinkRef = \"javascript:''\";\n }\n var safeHtml = goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract(goog.string.Const.from(\"b/12014412, meta tag with sanitized URL\"), '\\x3cmeta name\\x3d\"referrer\" content\\x3d\"no-referrer\"\\x3e' + '\\x3cmeta http-equiv\\x3d\"refresh\" content\\x3d\"0; url\\x3d' + goog.string.htmlEscape(sanitizedLinkRef) + '\"\\x3e');\n var newDoc = newWin.document;\n if (newDoc && newDoc.write) {\n goog.dom.safe.documentWrite(newDoc, safeHtml);\n newDoc.close();\n }\n }\n } else {\n newWin = goog.dom.safe.openInWindow(safeLinkRef, parentWin, target, optionString);\n if (newWin && opt_options[\"noopener\"]) {\n newWin.opener = null;\n }\n if (newWin && opt_options[\"noreferrer\"]) {\n newWin.opener = null;\n }\n }\n return newWin;\n};\ngoog.window.openBlank = function(opt_message, opt_options, opt_parentWin) {\n const win = goog.window.open(\"\", opt_options, opt_parentWin);\n if (win && opt_message) {\n const body = win.document.body;\n if (body) {\n body.textContent = opt_message;\n }\n }\n return win;\n};\ngoog.window.popup = function(linkRef, opt_options) {\n if (!opt_options) {\n opt_options = {};\n }\n opt_options[\"target\"] = opt_options[\"target\"] || linkRef[\"target\"] || goog.window.DEFAULT_POPUP_TARGET;\n opt_options[\"width\"] = opt_options[\"width\"] || goog.window.DEFAULT_POPUP_WIDTH;\n opt_options[\"height\"] = opt_options[\"height\"] || goog.window.DEFAULT_POPUP_HEIGHT;\n var newWin = goog.window.open(linkRef, opt_options);\n if (!newWin) {\n return true;\n }\n newWin.focus();\n return false;\n};\n","~:source","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities for window manipulation.\n */\n\n\ngoog.provide('goog.window');\n\ngoog.require('goog.dom');\ngoog.require('goog.dom.TagName');\ngoog.require('goog.dom.safe');\ngoog.require('goog.html.SafeUrl');\ngoog.require('goog.html.uncheckedconversions');\ngoog.require('goog.labs.userAgent.platform');\ngoog.require('goog.string');\ngoog.require('goog.string.Const');\ngoog.require('goog.userAgent');\ngoog.requireType('goog.string.TypedString');\n\n\n/**\n * Default height for popup windows\n * @type {number}\n */\ngoog.window.DEFAULT_POPUP_HEIGHT = 500;\n\n\n/**\n * Default width for popup windows\n * @type {number}\n */\ngoog.window.DEFAULT_POPUP_WIDTH = 690;\n\n\n/**\n * Default target for popup windows\n * @type {string}\n */\ngoog.window.DEFAULT_POPUP_TARGET = 'google_popup';\n\n\n/**\n * @return {!Window}\n * @suppress {checkTypes}\n * @private\n */\ngoog.window.createFakeWindow_ = function() {\n 'use strict';\n return /** @type {!Window} */ ({});\n};\n\n/**\n * Opens a new window.\n *\n * @param {!goog.html.SafeUrl|string|!Object|null} linkRef If an Object with an\n * 'href' attribute (such as HTMLAnchorElement) is passed then the value of\n * 'href' is used, otherwise its toString method is called. Note that if a\n * string|Object is used, it will be sanitized with SafeUrl.sanitize().\n *\n * @param {?Object=} opt_options supports the following options:\n * 'target': (string) target (window name). If null, linkRef.target will\n * be used.\n * 'width': (number) window width.\n * 'height': (number) window height.\n * 'top': (number) distance from top of screen\n * 'left': (number) distance from left of screen\n * 'toolbar': (boolean) show toolbar\n * 'scrollbars': (boolean) show scrollbars\n * 'location': (boolean) show location\n * 'statusbar': (boolean) show statusbar\n * 'menubar': (boolean) show menubar\n * 'resizable': (boolean) resizable\n * 'noreferrer': (boolean) whether to attempt to remove the referrer header\n * from the request headers. Does this by opening a blank window that\n * then redirects to the target url, so users may see some flickering.\n * 'noopener': (boolean) whether to remove the `opener` property from the\n * window object of the newly created window. The property contains a\n * reference to the original window, and can be used to launch a\n * reverse tabnabbing attack.\n *\n * @param {?Window=} opt_parentWin Parent window that should be used to open the\n * new window.\n *\n * @return {?Window} Returns the window object that was opened. This returns\n * null if a popup blocker prevented the window from being\n * opened. In case when a new window is opened in a different\n * browser sandbox (such as iOS standalone mode), the returned\n * object is a emulated Window object that functions as if\n * a cross-origin window has been opened.\n */\ngoog.window.open = function(linkRef, opt_options, opt_parentWin) {\n 'use strict';\n if (!opt_options) {\n opt_options = {};\n }\n var parentWin = opt_parentWin || window;\n\n /** @type {!goog.html.SafeUrl} */\n var safeLinkRef;\n\n if (linkRef instanceof goog.html.SafeUrl) {\n safeLinkRef = linkRef;\n } else {\n // HTMLAnchorElement has a toString() method with the same behavior as\n // goog.Uri in all browsers except for Safari, which returns\n // '[object HTMLAnchorElement]'. We check for the href first, then\n // assume that it's a goog.Uri or String otherwise.\n /**\n * @type {string|!goog.string.TypedString}\n * @suppress {missingProperties}\n */\n var url =\n typeof linkRef.href != 'undefined' ? linkRef.href : String(linkRef);\n safeLinkRef = goog.html.SafeUrl.sanitize(url);\n }\n\n /** @suppress {strictMissingProperties} */\n const browserSupportsCoop = self.crossOriginIsolated !== undefined;\n let referrerPolicy = 'strict-origin-when-cross-origin';\n if (window.Request) {\n /** @suppress {missingProperties} */\n referrerPolicy = new Request('/').referrerPolicy;\n }\n const pageSetsUnsafeReferrerPolicy = referrerPolicy === 'unsafe-url';\n\n // Opening popups with `noreferrer` and a COOP policy of\n // `same-origin-allow-popups` doesn't work. The below is a workaround\n // for this browser limitation.\n let noReferrerOption = opt_options['noreferrer'];\n if (browserSupportsCoop && noReferrerOption) {\n if (pageSetsUnsafeReferrerPolicy) {\n // If the browser supports COOP, and the page explicitly sets a\n // referrer-policy of `unsafe-url`, and the caller requests that the\n // referrer is hidden, then things may break. We can't support the\n // noreferrer option in this case, but ignoring it is potentially unsafe\n // since the page is configured to expose the full URL. We just throw in\n // this case so that callers can make a decision as to what they want to\n // do here.\n throw new Error(\n 'Cannot use the noreferrer option on a page that sets a referrer-policy of `unsafe-url` in modern browsers!');\n }\n // Any browser that supports COOP defaults to a referrer policy that hides\n // the full URL. So we don't need to explicitly hide the referrer ourselves\n // and can instead rely on the browser's default referrer policy to hide the\n // referrer.\n noReferrerOption = false;\n }\n\n /** @suppress {missingProperties} loose references to 'target' */\n /** @suppress {strictMissingProperties} */\n var target = opt_options.target || linkRef.target;\n\n var sb = [];\n for (var option in opt_options) {\n switch (option) {\n case 'width':\n case 'height':\n case 'top':\n case 'left':\n sb.push(option + '=' + opt_options[option]);\n break;\n case 'target':\n case 'noopener':\n case 'noreferrer':\n break;\n default:\n sb.push(option + '=' + (opt_options[option] ? 1 : 0));\n }\n }\n var optionString = sb.join(',');\n\n var newWin;\n if (goog.labs.userAgent.platform.isIos() && parentWin.navigator &&\n parentWin.navigator['standalone'] && target && target != '_self') {\n // iOS in standalone mode disregards \"target\" in window.open and always\n // opens new URL in the same window. The workaround is to create an \"A\"\n // element and send a click event to it.\n // Notice that the \"A\" tag does NOT have to be added to the DOM.\n\n var a = goog.dom.createElement(goog.dom.TagName.A);\n goog.dom.safe.setAnchorHref(a, safeLinkRef);\n\n a.target = target;\n if (noReferrerOption) {\n a.rel = 'noreferrer';\n }\n\n var click = /** @type {!MouseEvent} */ (document.createEvent('MouseEvent'));\n click.initMouseEvent(\n 'click',\n true, // canBubble\n true, // cancelable\n parentWin,\n 1); // detail = mousebutton\n a.dispatchEvent(click);\n // New window is not available in this case. Instead, a fake Window object\n // is returned. In particular, it will have window.document undefined. In\n // general, it will appear to most of clients as a Window for a different\n // origin. Since iOS standalone web apps are run in their own sandbox, this\n // is the most appropriate return value.\n newWin = goog.window.createFakeWindow_();\n } else if (noReferrerOption) {\n // This code used to use meta-refresh to stop the referrer from being\n // included in the request headers. This was the only cross-browser way\n // to remove the referrer circa 2009. However, this never worked in Chrome,\n // and, instead newWin.opener had to be set to null on this browser. This\n // behavior is slated to be removed in Chrome and should not be relied\n // upon. Referrer Policy is the only spec'd and supported way of stripping\n // referrers and works across all current browsers. This is used in\n // addition to the aforementioned tricks.\n //\n // We also set the opener to be set to null in the new window, thus\n // disallowing the opened window from navigating its opener.\n //\n // Detecting user agent and then using a different strategy per browser\n // would allow the referrer to leak in case of an incorrect/missing user\n // agent.\n newWin = goog.dom.safe.openInWindow('', parentWin, target, optionString);\n\n var sanitizedLinkRef = goog.html.SafeUrl.unwrap(safeLinkRef);\n if (newWin) {\n if (goog.userAgent.EDGE_OR_IE) {\n // IE/EDGE can't parse the content attribute if the url contains\n // a semicolon. We can fix this by adding quotes around the url, but\n // then we can't parse quotes in the URL correctly. We take a\n // best-effort approach.\n //\n // If the URL has semicolons, wrap it in single quotes to protect\n // the semicolons.\n // If the URL has semicolons and single quotes, url-encode the single\n // quotes as well.\n //\n // This is imperfect. Notice that both ' and ; are reserved characters\n // in URIs, so this could do the wrong thing, but at least it will\n // do the wrong thing in only rare cases.\n // ugh.\n if (goog.string.contains(sanitizedLinkRef, ';')) {\n sanitizedLinkRef =\n '\\'' + sanitizedLinkRef.replace(/'/g, '%27') + '\\'';\n }\n }\n newWin.opener = null;\n // Using a blank value for the URL causes the new window to load\n // this window's location. Instead, using this javascript URL causes an\n // error to be thrown in the blank document and abort the loading of the\n // page location. The window's location does update, but the content is\n // never requested/loaded.\n // Other values tried here include:\n // - an empty string or no value at all (page load succeeds)\n // - 'about:blank' (causes security exceptions if users\n // later try and assign to the window's location, as about:blank is now\n // cross-origin from this window).\n if (sanitizedLinkRef === '') {\n sanitizedLinkRef = 'javascript:\\'\\'';\n }\n // TODO(rjamet): Building proper SafeHtml with SafeHtml.createMetaRefresh\n // pulls in a lot of compiled code, which is composed of various unneeded\n // goog.html parts such as SafeStyle.create among others. So, for now,\n // keep the unchecked conversion until we figure out how to make the\n // dependencies of createSafeHtmlTagSecurityPrivateDoNotAccessOrElse less\n // heavy.\n var safeHtml =\n goog.html.uncheckedconversions\n .safeHtmlFromStringKnownToSatisfyTypeContract(\n goog.string.Const.from(\n 'b/12014412, meta tag with sanitized URL'),\n '<meta name=\"referrer\" content=\"no-referrer\">' +\n '<meta http-equiv=\"refresh\" content=\"0; url=' +\n goog.string.htmlEscape(sanitizedLinkRef) + '\">');\n\n // During window loading `newWin.document` may be unset in some browsers.\n // Storing and checking a reference to the document prevents NPEs.\n var newDoc = newWin.document;\n if (newDoc && newDoc.write) {\n goog.dom.safe.documentWrite(newDoc, safeHtml);\n newDoc.close();\n }\n }\n } else {\n newWin = goog.dom.safe.openInWindow(\n safeLinkRef, parentWin, target, optionString);\n // Passing in 'noopener' into the 'windowFeatures' param of window.open(...)\n // will yield a feature-deprived browser. This is an known issue, tracked\n // here: https://github.com/whatwg/html/issues/1902\n if (newWin && opt_options['noopener']) {\n newWin.opener = null;\n }\n // If the caller specified noreferrer and we hit this branch, it means that\n // we're already running on a modern enough browser that the referrer is\n // hidden by default. But setting noreferrer implies noopener too, so we\n // also have to clear the opener here.\n if (newWin && opt_options['noreferrer']) {\n newWin.opener = null;\n }\n }\n // newWin is null if a popup blocker prevented the window open.\n return newWin;\n};\n\n\n/**\n * Opens a new window without any real content in it.\n *\n * This can be used to get around popup blockers if you need to open a window\n * in response to a user event, but need to do asynchronous work to determine\n * the URL to open, and then set the URL later.\n *\n * Example usage:\n *\n * var newWin = goog.window.openBlank('Loading...');\n * setTimeout(\n * function() {\n * newWin.location.href = 'http://www.google.com';\n * }, 100);\n *\n * @param {string=} opt_message String to show in the new window. This string\n * will be HTML-escaped to avoid XSS issues.\n * @param {?Object=} opt_options Options to open window with.\n * {@see goog.window.open for exact option semantics}.\n * @param {?Window=} opt_parentWin Parent window that should be used to open the\n * new window.\n * @return {?Window} Returns the window object that was opened. This returns\n * null if a popup blocker prevented the window from being\n * opened.\n */\ngoog.window.openBlank = function(opt_message, opt_options, opt_parentWin) {\n 'use strict';\n const win =\n /** @type {?Window} */ (goog.window.open('', opt_options, opt_parentWin));\n if (win && opt_message) {\n const body = win.document.body;\n if (body) {\n // The body can be undefined in IE, where for some reason the created\n // document doesn't have a body.\n body.textContent = opt_message;\n }\n }\n return win;\n};\n\n\n/**\n * Raise a help popup window, defaulting to \"Google standard\" size and name.\n *\n * (If your project is using GXPs, consider using {@link PopUpLink.gxp}.)\n *\n * @param {?goog.html.SafeUrl|string|?Object} linkRef If an Object with an\n * 'href' attribute (such as HTMLAnchorElement) is passed then the value of\n * 'href' is used, otherwise otherwise its toString method is called. Note\n * that if a string|Object is used, it will be sanitized with\n * SafeUrl.sanitize().\n *\n * @param {?Object=} opt_options Options to open window with.\n * {@see goog.window.open for exact option semantics}\n * Additional wrinkles to the options:\n * - if 'target' field is null, linkRef.target will be used. If *that's*\n * null, the default is \"google_popup\".\n * - if 'width' field is not specified, the default is 690.\n * - if 'height' field is not specified, the default is 500.\n *\n * @return {boolean} true if the window was not popped up, false if it was.\n */\ngoog.window.popup = function(linkRef, opt_options) {\n 'use strict';\n if (!opt_options) {\n opt_options = {};\n }\n\n // set default properties\n opt_options['target'] = opt_options['target'] || linkRef['target'] ||\n goog.window.DEFAULT_POPUP_TARGET;\n opt_options['width'] =\n opt_options['width'] || goog.window.DEFAULT_POPUP_WIDTH;\n opt_options['height'] =\n opt_options['height'] || goog.window.DEFAULT_POPUP_HEIGHT;\n\n var newWin = goog.window.open(linkRef, opt_options);\n if (!newWin) {\n return true;\n }\n newWin.focus();\n\n return false;\n};\n","~:compiled-at",1684858198037,"~:source-map-json","{\n\"version\":3,\n\"file\":\"goog.window.window.js\",\n\"lineCount\":129,\n\"mappings\":\"AAWAA,IAAKC,CAAAA,OAAL,CAAa,aAAb,CAAA;AAEAD,IAAKE,CAAAA,OAAL,CAAa,UAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,kBAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,eAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,mBAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,gCAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,8BAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,aAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,mBAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,gBAAb,CAAA;AACAF,IAAKG,CAAAA,WAAL,CAAiB,yBAAjB,CAAA;AAOAH,IAAKI,CAAAA,MAAOC,CAAAA,oBAAZ,GAAmC,GAAnC;AAOAL,IAAKI,CAAAA,MAAOE,CAAAA,mBAAZ,GAAkC,GAAlC;AAOAN,IAAKI,CAAAA,MAAOG,CAAAA,oBAAZ,GAAmC,cAAnC;AAQAP,IAAKI,CAAAA,MAAOI,CAAAA,iBAAZ,GAAgCC,QAAQ,EAAG;AAEzC,SAA+B,EAA/B;AAFyC,CAA3C;AA4CAT,IAAKI,CAAAA,MAAOM,CAAAA,IAAZ,GAAmBC,QAAQ,CAACC,OAAD,EAAUC,WAAV,EAAuBC,aAAvB,CAAsC;AAE/D,MAAI,CAACD,WAAL;AACEA,eAAA,GAAc,EAAd;AADF;AAGA,MAAIE,YAAYD,aAAZC,IAA6BX,MAAjC;AAGA,MAAIY,WAAJ;AAEA,MAAIJ,OAAJ,YAAuBZ,IAA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",\n\"sources\":[\"goog/window/window.js\"],\n\"sourcesContent\":[\"/**\\n * @license\\n * Copyright The Closure Library Authors.\\n * SPDX-License-Identifier: Apache-2.0\\n */\\n\\n/**\\n * @fileoverview Utilities for window manipulation.\\n */\\n\\n\\ngoog.provide('goog.window');\\n\\ngoog.require('goog.dom');\\ngoog.require('goog.dom.TagName');\\ngoog.require('goog.dom.safe');\\ngoog.require('goog.html.SafeUrl');\\ngoog.require('goog.html.uncheckedconversions');\\ngoog.require('goog.labs.userAgent.platform');\\ngoog.require('goog.string');\\ngoog.require('goog.string.Const');\\ngoog.require('goog.userAgent');\\ngoog.requireType('goog.string.TypedString');\\n\\n\\n/**\\n * Default height for popup windows\\n * @type {number}\\n */\\ngoog.window.DEFAULT_POPUP_HEIGHT = 500;\\n\\n\\n/**\\n * Default width for popup windows\\n * @type {number}\\n */\\ngoog.window.DEFAULT_POPUP_WIDTH = 690;\\n\\n\\n/**\\n * Default target for popup windows\\n * @type {string}\\n */\\ngoog.window.DEFAULT_POPUP_TARGET = 'google_popup';\\n\\n\\n/**\\n * @return {!Window}\\n * @suppress {checkTypes}\\n * @private\\n */\\ngoog.window.createFakeWindow_ = function() {\\n 'use strict';\\n return /** @type {!Window} */ ({});\\n};\\n\\n/**\\n * Opens a new window.\\n *\\n * @param {!goog.html.SafeUrl|string|!Object|null} linkRef If an Object with an\\n * 'href' attribute (such as HTMLAnchorElement) is passed then the value of\\n * 'href' is used, otherwise its toString method is called. Note that if a\\n * string|Object is used, it will be sanitized with SafeUrl.sanitize().\\n *\\n * @param {?Object=} opt_options supports the following options:\\n * 'target': (string) target (window name). If null, linkRef.target will\\n * be used.\\n * 'width': (number) window width.\\n * 'height': (number) window height.\\n * 'top': (number) distance from top of screen\\n * 'left': (number) distance from left of screen\\n * 'toolbar': (boolean) show toolbar\\n * 'scrollbars': (boolean) show scrollbars\\n * 'location': (boolean) show location\\n * 'statusbar': (boolean) show statusbar\\n * 'menubar': (boolean) show menubar\\n * 'resizable': (boolean) resizable\\n * 'noreferrer': (boolean) whether to attempt to remove the referrer header\\n * from the request headers. Does this by opening a blank window that\\n * then redirects to the target url, so users may see some flickering.\\n * 'noopener': (boolean) whether to remove the `opener` property from the\\n * window object of the newly created window. The property contains a\\n * reference to the original window, and can be used to launch a\\n * reverse tabnabbing attack.\\n *\\n * @param {?Window=} opt_parentWin Parent window that should be used to open the\\n * new window.\\n *\\n * @return {?Window} Returns the window object that was opened. This returns\\n * null if a popup blocker prevented the window from being\\n * opened. In case when a new window is opened in a different\\n * browser sandbox (such as iOS standalone mode), the returned\\n * object is a emulated Window object that functions as if\\n * a cross-origin window has been opened.\\n */\\ngoog.window.open = function(linkRef, opt_options, opt_parentWin) {\\n 'use strict';\\n if (!opt_options) {\\n opt_options = {};\\n }\\n var parentWin = opt_parentWin || window;\\n\\n /** @type {!goog.html.SafeUrl} */\\n var safeLinkRef;\\n\\n if (linkRef instanceof goog.html.SafeUrl) {\\n safeLinkRef = linkRef;\\n } else {\\n // HTMLAnchorElement has a toString() method with the same behavior as\\n // goog.Uri in all browsers except for Safari, which returns\\n // '[object HTMLAnchorElement]'. We check for the href first, then\\n // assume that it's a goog.Uri or String otherwise.\\n /**\\n * @type {string|!goog.string.TypedString}\\n * @suppress {missingProperties}\\n */\\n var url =\\n typeof linkRef.href != 'undefined' ? linkRef.href : String(linkRef);\\n safeLinkRef = goog.html.SafeUrl.sanitize(url);\\n }\\n\\n /** @suppress {strictMissingProperties} */\\n const browserSupportsCoop = self.crossOriginIsolated !== undefined;\\n let referrerPolicy = 'strict-origin-when-cross-origin';\\n if (window.Request) {\\n /** @suppress {missingProperties} */\\n referrerPolicy = new Request('/').referrerPolicy;\\n }\\n const pageSetsUnsafeReferrerPolicy = referrerPolicy === 'unsafe-url';\\n\\n // Opening popups with `noreferrer` and a COOP policy of\\n // `same-origin-allow-popups` doesn't work. The below is a workaround\\n // for this browser limitation.\\n let noReferrerOption = opt_options['noreferrer'];\\n if (browserSupportsCoop && noReferrerOption) {\\n if (pageSetsUnsafeReferrerPolicy) {\\n // If the browser supports COOP, and the page explicitly sets a\\n // referrer-policy of `unsafe-url`, and the caller requests that the\\n // referrer is hidden, then things may break. We can't support the\\n // noreferrer option in this case, but ignoring it is potentially unsafe\\n // since the page is configured to expose the full URL. We just throw in\\n // this case so that callers can make a decision as to what they want to\\n // do here.\\n throw new Error(\\n 'Cannot use the noreferrer option on a page that sets a referrer-policy of `unsafe-url` in modern browsers!');\\n }\\n // Any browser that supports COOP defaults to a referrer policy that hides\\n // the full URL. So we don't need to explicitly hide the referrer ourselves\\n // and can instead rely on the browser's default referrer policy to hide the\\n // referrer.\\n noReferrerOption = false;\\n }\\n\\n /** @suppress {missingProperties} loose references to 'target' */\\n /** @suppress {strictMissingProperties} */\\n var target = opt_options.target || linkRef.target;\\n\\n var sb = [];\\n for (var option in opt_options) {\\n switch (option) {\\n case 'width':\\n case 'height':\\n case 'top':\\n case 'left':\\n sb.push(option + '=' + opt_options[option]);\\n break;\\n case 'target':\\n case 'noopener':\\n case 'noreferrer':\\n break;\\n default:\\n sb.push(option + '=' + (opt_options[option] ? 1 : 0));\\n }\\n }\\n var optionString = sb.join(',');\\n\\n var newWin;\\n if (goog.labs.userAgent.platform.isIos() && parentWin.navigator &&\\n parentWin.navigator['standalone'] && target && target != '_self') {\\n // iOS in standalone mode disregards \\\"target\\\" in window.open and always\\n // opens new URL in the same window. The workaround is to create an \\\"A\\\"\\n // element and send a click event to it.\\n // Notice that the \\\"A\\\" tag does NOT have to be added to the DOM.\\n\\n var a = goog.dom.createElement(goog.dom.TagName.A);\\n goog.dom.safe.setAnchorHref(a, safeLinkRef);\\n\\n a.target = target;\\n if (noReferrerOption) {\\n a.rel = 'noreferrer';\\n }\\n\\n var click = /** @type {!MouseEvent} */ (document.createEvent('MouseEvent'));\\n click.initMouseEvent(\\n 'click',\\n true, // canBubble\\n true, // cancelable\\n parentWin,\\n 1); // detail = mousebutton\\n a.dispatchEvent(click);\\n // New window is not available in this case. Instead, a fake Window object\\n // is returned. In particular, it will have window.document undefined. In\\n // general, it will appear to most of clients as a Window for a different\\n // origin. Since iOS standalone web apps are run in their own sandbox, this\\n // is the most appropriate return value.\\n newWin = goog.window.createFakeWindow_();\\n } else if (noReferrerOption) {\\n // This code used to use meta-refresh to stop the referrer from being\\n // included in the request headers. This was the only cross-browser way\\n // to remove the referrer circa 2009. However, this never worked in Chrome,\\n // and, instead newWin.opener had to be set to null on this browser. This\\n // behavior is slated to be removed in Chrome and should not be relied\\n // upon. Referrer Policy is the only spec'd and supported way of stripping\\n // referrers and works across all current browsers. This is used in\\n // addition to the aforementioned tricks.\\n //\\n // We also set the opener to be set to null in the new window, thus\\n // disallowing the opened window from navigating its opener.\\n //\\n // Detecting user agent and then using a different strategy per browser\\n // would allow the referrer to leak in case of an incorrect/missing user\\n // agent.\\n newWin = goog.dom.safe.openInWindow('', parentWin, target, optionString);\\n\\n var sanitizedLinkRef = goog.html.SafeUrl.unwrap(safeLinkRef);\\n if (newWin) {\\n if (goog.userAgent.EDGE_OR_IE) {\\n // IE/EDGE can't parse the content attribute if the url contains\\n // a semicolon. We can fix this by adding quotes around the url, but\\n // then we can't parse quotes in the URL correctly. We take a\\n // best-effort approach.\\n //\\n // If the URL has semicolons, wrap it in single quotes to protect\\n // the semicolons.\\n // If the URL has semicolons and single quotes, url-encode the single\\n // quotes as well.\\n //\\n // This is imperfect. Notice that both ' and ; are reserved characters\\n // in URIs, so this could do the wrong thing, but at least it will\\n // do the wrong thing in only rare cases.\\n // ugh.\\n if (goog.string.contains(sanitizedLinkRef, ';')) {\\n sanitizedLinkRef =\\n '\\\\'' + sanitizedLinkRef.replace(/'/g, '%27') + '\\\\'';\\n }\\n }\\n newWin.opener = null;\\n // Using a blank value for the URL causes the new window to load\\n // this window's location. Instead, using this javascript URL causes an\\n // error to be thrown in the blank document and abort the loading of the\\n // page location. The window's location does update, but the content is\\n // never requested/loaded.\\n // Other values tried here include:\\n // - an empty string or no value at all (page load succeeds)\\n // - 'about:blank' (causes security exceptions if users\\n // later try and assign to the window's location, as about:blank is now\\n // cross-origin from this window).\\n if (sanitizedLinkRef === '') {\\n sanitizedLinkRef = 'javascript:\\\\'\\\\'';\\n }\\n // TODO(rjamet): Building proper SafeHtml with SafeHtml.createMetaRefresh\\n // pulls in a lot of compiled code, which is composed of various unneeded\\n // goog.html parts such as SafeStyle.create among others. So, for now,\\n // keep the unchecked conversion until we figure out how to make the\\n // dependencies of createSafeHtmlTagSecurityPrivateDoNotAccessOrElse less\\n // heavy.\\n var safeHtml =\\n goog.html.uncheckedconversions\\n .safeHtmlFromStringKnownToSatisfyTypeContract(\\n goog.string.Const.from(\\n 'b/12014412, meta tag with sanitized URL'),\\n '<meta name=\\\"referrer\\\" content=\\\"no-referrer\\\">' +\\n '<meta http-equiv=\\\"refresh\\\" content=\\\"0; url=' +\\n goog.string.htmlEscape(sanitizedLinkRef) + '\\\">');\\n\\n // During window loading `newWin.document` may be unset in some browsers.\\n // Storing and checking a reference to the document prevents NPEs.\\n var newDoc = newWin.document;\\n if (newDoc && newDoc.write) {\\n goog.dom.safe.documentWrite(newDoc, safeHtml);\\n newDoc.close();\\n }\\n }\\n } else {\\n newWin = goog.dom.safe.openInWindow(\\n safeLinkRef, parentWin, target, optionString);\\n // Passing in 'noopener' into the 'windowFeatures' param of window.open(...)\\n // will yield a feature-deprived browser. This is an known issue, tracked\\n // here: https://github.com/whatwg/html/issues/1902\\n if (newWin && opt_options['noopener']) {\\n newWin.opener = null;\\n }\\n // If the caller specified noreferrer and we hit this branch, it means that\\n // we're already running on a modern enough browser that the referrer is\\n // hidden by default. But setting noreferrer implies noopener too, so we\\n // also have to clear the opener here.\\n if (newWin && opt_options['noreferrer']) {\\n newWin.opener = null;\\n }\\n }\\n // newWin is null if a popup blocker prevented the window open.\\n return newWin;\\n};\\n\\n\\n/**\\n * Opens a new window without any real content in it.\\n *\\n * This can be used to get around popup blockers if you need to open a window\\n * in response to a user event, but need to do asynchronous work to determine\\n * the URL to open, and then set the URL later.\\n *\\n * Example usage:\\n *\\n * var newWin = goog.window.openBlank('Loading...');\\n * setTimeout(\\n * function() {\\n * newWin.location.href = 'http://www.google.com';\\n * }, 100);\\n *\\n * @param {string=} opt_message String to show in the new window. This string\\n * will be HTML-escaped to avoid XSS issues.\\n * @param {?Object=} opt_options Options to open window with.\\n * {@see goog.window.open for exact option semantics}.\\n * @param {?Window=} opt_parentWin Parent window that should be used to open the\\n * new window.\\n * @return {?Window} Returns the window object that was opened. This returns\\n * null if a popup blocker prevented the window from being\\n * opened.\\n */\\ngoog.window.openBlank = function(opt_message, opt_options, opt_parentWin) {\\n 'use strict';\\n const win =\\n /** @type {?Window} */ (goog.window.open('', opt_options, opt_parentWin));\\n if (win && opt_message) {\\n const body = win.document.body;\\n if (body) {\\n // The body can be undefined in IE, where for some reason the created\\n // document doesn't have a body.\\n body.textContent = opt_message;\\n }\\n }\\n return win;\\n};\\n\\n\\n/**\\n * Raise a help popup window, defaulting to \\\"Google standard\\\" size and name.\\n *\\n * (If your project is using GXPs, consider using {@link PopUpLink.gxp}.)\\n *\\n * @param {?goog.html.SafeUrl|string|?Object} linkRef If an Object with an\\n * 'href' attribute (such as HTMLAnchorElement) is passed then the value of\\n * 'href' is used, otherwise otherwise its toString method is called. Note\\n * that if a string|Object is used, it will be sanitized with\\n * SafeUrl.sanitize().\\n *\\n * @param {?Object=} opt_options Options to open window with.\\n * {@see goog.window.open for exact option semantics}\\n * Additional wrinkles to the options:\\n * - if 'target' field is null, linkRef.target will be used. If *that's*\\n * null, the default is \\\"google_popup\\\".\\n * - if 'width' field is not specified, the default is 690.\\n * - if 'height' field is not specified, the default is 500.\\n *\\n * @return {boolean} true if the window was not popped up, false if it was.\\n */\\ngoog.window.popup = function(linkRef, opt_options) {\\n 'use strict';\\n if (!opt_options) {\\n opt_options = {};\\n }\\n\\n // set default properties\\n opt_options['target'] = opt_options['target'] || linkRef['target'] ||\\n goog.window.DEFAULT_POPUP_TARGET;\\n opt_options['width'] =\\n opt_options['width'] || goog.window.DEFAULT_POPUP_WIDTH;\\n opt_options['height'] =\\n opt_options['height'] || goog.window.DEFAULT_POPUP_HEIGHT;\\n\\n var newWin = goog.window.open(linkRef, opt_options);\\n if (!newWin) {\\n return true;\\n }\\n newWin.focus();\\n\\n return false;\\n};\\n\"],\n\"names\":[\"goog\",\"provide\",\"require\",\"requireType\",\"window\",\"DEFAULT_POPUP_HEIGHT\",\"DEFAULT_POPUP_WIDTH\",\"DEFAULT_POPUP_TARGET\",\"createFakeWindow_\",\"goog.window.createFakeWindow_\",\"open\",\"goog.window.open\",\"linkRef\",\"opt_options\",\"opt_parentWin\",\"parentWin\",\"safeLinkRef\",\"html\",\"SafeUrl\",\"url\",\"href\",\"String\",\"sanitize\",\"browserSupportsCoop\",\"self\",\"crossOriginIsolated\",\"undefined\",\"referrerPolicy\",\"Request\",\"pageSetsUnsafeReferrerPolicy\",\"noReferrerOption\",\"Error\",\"target\",\"sb\",\"option\",\"push\",\"optionString\",\"join\",\"newWin\",\"labs\",\"userAgent\",\"platform\",\"isIos\",\"navigator\",\"a\",\"dom\",\"createElement\",\"TagName\",\"A\",\"safe\",\"setAnchorHref\",\"rel\",\"click\",\"document\",\"createEvent\",\"initMouseEvent\",\"dispatchEvent\",\"openInWindow\",\"sanitizedLinkRef\",\"unwrap\",\"EDGE_OR_IE\",\"string\",\"contains\",\"replace\",\"opener\",\"safeHtml\",\"uncheckedconversions\",\"safeHtmlFromStringKnownToSatisfyTypeContract\",\"Const\",\"from\",\"htmlEscape\",\"newDoc\",\"write\",\"documentWrite\",\"close\",\"openBlank\",\"goog.window.openBlank\",\"opt_message\",\"win\",\"body\",\"textContent\",\"popup\",\"goog.window.popup\",\"focus\"]\n}\n"]