%notificationDTD; %browserDTD; %brandDTD; ]> (ChromeUtils.import("resource://gre/modules/ExtensionSearchHandler.jsm", {})).ExtensionSearchHandler; { this._enableOrDisableOneOffSearches(); }, {capturing: true, once: true}); // history dropmarker open state this.popup.addEventListener("popupshowing", () => { this.setAttribute("open", "true"); }); this.popup.addEventListener("popuphidden", () => { requestAnimationFrame(() => { this.removeAttribute("open"); }); }); ]]> document.getAnonymousElementByAttribute(this, "anonid", "urlbar-go-button"); "" false null false { this.replayAllDeferredKeyEvents(); this._deferredKeyEventTimeout = null; }, Math.max(0, remaining)); } ]]> new Set([ KeyboardEvent.DOM_VK_RETURN, KeyboardEvent.DOM_VK_DOWN, KeyboardEvent.DOM_VK_TAB, ]) [] null 200 0 { this.replaySafeDeferredKeyEvents(); }); ]]> { this.replayAllDeferredKeyEvents(); }); ]]> true true { if (where != "current" || browser.lastLocationChange == lastLocationChange) { this._loadURL(data.url, browser, data.postData, where, openUILinkParams, data.mayInheritPrincipal, triggeringPrincipal); } }); return; } } this._loadURL(url, browser, postData, where, openUILinkParams, mayInheritPrincipal, triggeringPrincipal); ]]> = 0) { url = url.substring(0, firstSlash) + suffix + url.substring(firstSlash + 1); } else { url = url + suffix; } this.popup.overrideValue = "http://www." + url; ]]> 0 && links[0].url) { let triggeringPrincipal = browserDragAndDrop.getTriggeringPrincipal(aEvent); aEvent.preventDefault(); let url = links[0].url; let strippedURL = stripUnsafeProtocolOnPaste(url); if (strippedURL != url) { aEvent.stopImmediatePropagation(); return null; } let urlObj; try { // If this throws, urlSecurityCheck would also throw, as that's what it // does with things that don't pass the IO service's newURI constructor // without fixup. It's conceivable we may want to relax this check in // the future (so e.g. www.foo.com gets fixed up), but not right now. urlObj = new URL(url); // If we succeed, try to pass security checks. If this works, return the // URL object. If the *security checks* fail, return null. try { urlSecurityCheck(url, triggeringPrincipal, Ci.nsIScriptSecurityManager.DISALLOW_INHERIT_PRINCIPAL); return urlObj; } catch (ex) { return null; } } catch (ex) { // We couldn't make a URL out of this. Continue on, and return text below. } } return aEvent.dataTransfer.getData("text/unicode"); ]]> 1) { return selectedVal; } // If the selection doesn't start at the beginning or doesn't span the // full domain or the URL bar is modified or there is no text at all, // nothing else to do here. if (this.selectionStart > 0 || this.valueIsTyped || selectedVal == "") return selectedVal; // The selection doesn't span the full domain if it doesn't contain a slash and is // followed by some character other than a slash. if (!selectedVal.includes("/")) { let remainder = inputVal.replace(selectedVal, ""); if (remainder != "" && remainder[0] != "/") return selectedVal; } // If the value was filled by a search suggestion, just return it. let action = this._parseActionUrl(this.value); if (action && action.type == "searchengine") return selectedVal; let uriFixup = Cc["@mozilla.org/docshell/urifixup;1"].getService(Ci.nsIURIFixup); let uri; if (this.getAttribute("pageproxystate") == "valid") { uri = gBrowser.currentURI; } else { // We're dealing with an autocompleted value, create a new URI from that. try { uri = uriFixup.createFixupURI(inputVal, Ci.nsIURIFixup.FIXUP_FLAG_NONE); } catch (e) {} if (!uri) return selectedVal; } uri = this.makeURIReadable(uri); // If the entire URL is selected, just use the actual loaded URI, // unless we want a decoded URI, or it's a data: or javascript: URI, // since those are hard to read when encoded. if (inputVal == selectedVal && !uri.schemeIs("javascript") && !uri.schemeIs("data") && !Services.prefs.getBoolPref("browser.urlbar.decodeURLsOnCopy")) { return uri.displaySpec; } // Just the beginning of the URL is selected, or we want a decoded // url. First check for a trimmed value. let spec = uri.displaySpec; let trimmedSpec = this.trimValue(spec); if (spec != trimmedSpec) { // Prepend the portion that trimValue removed from the beginning. // This assumes trimValue will only truncate the URL at // the beginning or end (or both). let trimmedSegments = spec.split(trimmedSpec); selectedVal = trimmedSegments[0] + selectedVal; } return selectedVal; ]]> 0) { this._prefs.setIntPref("timesBeforeHidingSuggestionsHint", remaining - 1); } ]]> = 0 && !this._pressedNoActionKeys.has(event.keyCode)) { if (this._pressedNoActionKeys.size == 0) { this.popup.setAttribute("noactions", "true"); this.removeAttribute("actiontype"); } this._pressedNoActionKeys.add(event.keyCode); } ]]> " + urlString + ""; var dt = event.dataTransfer; dt.setData("text/x-moz-url", urlString + "\n" + title); dt.setData("text/unicode", urlString); dt.setData("text/html", htmlString); dt.effectAllowed = "copyLink"; event.stopPropagation(); ]]> &brandShortName; 💡 &urlbar.searchSuggestionsNotification.hintPrefix; &urlbar.searchSuggestionsNotification.hint; 255 window.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIDOMWindowUtils); 0 Cc["@mozilla.org/intl/stringbundle;1"]. getService(Ci.nsIStringBundleService). createBundle("chrome://browser/locale/places/places.properties"); document.getAnonymousElementByAttribute( this, "anonid", "search-suggestions-notification" ); document.getAnonymousElementByAttribute(this, "anonid", "footer"); document.getAnonymousElementByAttribute(this, "anonid", "one-off-search-buttons"); false null maxRow && index != maxRow) newIndex = maxRow; else if (!reverse && index == -1 || newIndex < 0 && index != 0) newIndex = 0; if (newIndex < 0 && index == 0 || newIndex > maxRow && index == maxRow) newIndex = -1; return newIndex; } // Otherwise do not allow the selection to be removed. if (newIndex < 0) { newIndex = index > 0 ? 0 : maxRow; } else if (newIndex > maxRow) { newIndex = index < maxRow ? maxRow : 0; } return newIndex; ]]> 0 && this.input.mController .getStyleAt(0) .split(/\s+/).indexOf("heuristic") > 0; ]]> startOffset * 2) { // Provide more space when aligning would result in an unbalanced // margin. This allows the location bar to be moved to the start // of the navigation toolbar to reclaim space for results. endOffset = startOffset; } let identityIcon = document.getElementById("identity-icon"); let identityRect = this.DOMWindowUtils.getBoundsWithoutFlushing(identityIcon); let start = popupDirection == "rtl" ? documentRect.right - identityRect.right : identityRect.left; if (!this.margins || start != this.margins.start || endOffset != this.margins.end || width != this.margins.width) { this.margins = { start, end: endOffset, width }; needsHandleOverUnderflow = true; } } else if (this.margins) { // Reset the alignment so that the site icons are positioned // according to whatever's in the CSS. this.margins = undefined; needsHandleOverUnderflow = true; } // Now that the margins have been set, start adding items (via // _invalidate). this.mInput = aInput; this.input.controller.setInitiallySelectedIndex(this._isFirstResultHeuristic ? 0 : -1); this.input.userSelectionBehavior = "none"; this._invalidate(); try { let whichNotification = aInput.whichSearchSuggestionsNotification; if (whichNotification != "none") { // Update the impressions count on real popupshown, since there's // no guarantee openPopup will be respected by the platform. // Though, we must ensure the handled event is the expected one. let impressionId = this._searchSuggestionsImpressionId = {}; this.addEventListener("popupshown", () => { if (this._searchSuggestionsImpressionId == impressionId) aInput.updateSearchSuggestionsNotificationImpressions(whichNotification); }, {once: true}); this._showSearchSuggestionsNotification(whichNotification, popupDirection); } else if (this.classList.contains("showSearchSuggestionsNotification")) { this._hideSearchSuggestionsNotification(); } } catch (ex) { // Not critical for the urlbar functionality, just report the error. Cu.reportError(ex); } // Position the popup below the navbar. To get the y-coordinate, // which is an offset from the bottom of the input, subtract the // bottom of the navbar from the buttom of the input. let yOffset = Math.round( this.DOMWindowUtils.getBoundsWithoutFlushing(document.getElementById("nav-bar")).bottom - this.DOMWindowUtils.getBoundsWithoutFlushing(aInput).bottom); this.openPopup(aElement, "after_start", 0, yOffset, false, false); // Do this immediately after we've requested the popup to open. This // will cause sync reflows but prevents flickering. if (needsHandleOverUnderflow) { for (let item of this.richlistbox.childNodes) { item.handleOverUnderflow(); } } ]]> t != "action" && t != "heuristic"); try { // Some types intentionally do not map to strings, which is not // an error. parts.push(this._bundle.GetStringFromName(type + "ResultLabel")); } catch (e) {} return parts.filter(str => str).join(" "); ]]> 0) { let firstStyle = this.input.mController.getStyleAt(0); if (firstStyle.includes("autofill")) { let uri = this.input.mController.getFinalCompleteValueAt(0); this.maybeSetupSpeculativeConnect(uri); } else if (firstStyle.includes("searchengine") && this.input.browserSearchSuggestEnabled && this.input.urlbarSearchSuggestEnabled) { // Preconnect to the current search engine only if the search // suggestions are enabled. let engine = Services.search.currentEngine; engine.speculativeConnect({window, originAttributes: gBrowser.contentPrincipal.originAttributes}); } } // When a result is present the footer should always be visible. this.footer.collapsed = false; this.input.tabScrolling = true; this.input.gotResultForCurrentQuery = true; this.input.replaySafeDeferredKeyEvents(); ]]> null null {} [ "_invalidate", ] [ "search-suggestions-notification", "richlistbox", "one-off-search-buttons", ] {} 0) { this.maybeSetupSpeculativeConnect(url); } else if (url.startsWith("moz-action:remotetab")) { // URL is in the format moz-action:ACTION,PARAMS // Where PARAMS is a JSON encoded object. const MOZ_ACTION_REGEX = /^moz-action:([^,]+),(.*)$/; if (!MOZ_ACTION_REGEX.test(url)) return; let params = JSON.parse(url.match(MOZ_ACTION_REGEX)[2]); if (params.url) { this.maybeSetupSpeculativeConnect(decodeURIComponent(params.url)); } } ]]> document.getElementById("addon-progress-notification-progressmeter"); document.getElementById("addon-progress-notification-progresstext"); = 0) maxProgress += aInstall.maxProgress; if (aInstall.state < AddonManager.STATE_DOWNLOADED) downloadingCount++; }); if (downloadingCount == 0) { this.destroy(); if (Services.prefs.getBoolPref("xpinstall.customConfirmationUI", false)) { this.progressmeter.setAttribute("mode", "undetermined"); let status = gNavigatorBundle.getString("addonDownloadVerifying"); this.progresstext.setAttribute("value", status); this.progresstext.setAttribute("tooltiptext", status); } else { PopupNotifications.remove(this.notification); } } else { this.setProgress(progress, maxProgress); } ]]>