michael@0: michael@0: michael@0: # -*- Mode: HTML -*- michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: michael@0: %notificationDTD; michael@0: michael@0: %browserDTD; michael@0: ]> michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: true michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: true michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: { michael@0: [url, postData, mayInheritPrincipal] = response; michael@0: if (url) { michael@0: matchLastLocationChange = (lastLocationChange == michael@0: gBrowser.selectedBrowser.lastLocationChange); michael@0: continueOperation.call(this); michael@0: } michael@0: }); michael@0: } michael@0: michael@0: function continueOperation() michael@0: { michael@0: this.value = url; michael@0: gBrowser.userTypedValue = url; michael@0: try { michael@0: addToUrlbarHistory(url); michael@0: } catch (ex) { michael@0: // Things may go wrong when adding url to session history, michael@0: // but don't let that interfere with the loading of the url. michael@0: Cu.reportError(ex); michael@0: } michael@0: michael@0: function loadCurrent() { michael@0: let webnav = Ci.nsIWebNavigation; michael@0: let flags = webnav.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP | michael@0: webnav.LOAD_FLAGS_FIXUP_SCHEME_TYPOS; michael@0: // Pass LOAD_FLAGS_DISALLOW_INHERIT_OWNER to prevent any loads from michael@0: // inheriting the currently loaded document's principal, unless this michael@0: // URL is marked as safe to inherit (e.g. came from a bookmark michael@0: // keyword). michael@0: if (!mayInheritPrincipal) michael@0: flags |= Ci.nsIWebNavigation.LOAD_FLAGS_DISALLOW_INHERIT_OWNER; michael@0: gBrowser.loadURIWithFlags(url, flags, null, null, postData); michael@0: } michael@0: michael@0: // Focus the content area before triggering loads, since if the load michael@0: // occurs in a new tab, we want focus to be restored to the content michael@0: // area when the current tab is re-selected. michael@0: gBrowser.selectedBrowser.focus(); michael@0: michael@0: let isMouseEvent = aTriggeringEvent instanceof MouseEvent; michael@0: let altEnter = !isMouseEvent && aTriggeringEvent && aTriggeringEvent.altKey; michael@0: michael@0: if (altEnter) { michael@0: // XXX This was added a long time ago, and I'm not sure why it is michael@0: // necessary. Alt+Enter's default action might cause a system beep, michael@0: // or something like that? michael@0: aTriggeringEvent.preventDefault(); michael@0: aTriggeringEvent.stopPropagation(); michael@0: } michael@0: michael@0: // If the current tab is empty, ignore Alt+Enter (just reuse this tab) michael@0: altEnter = altEnter && !isTabEmpty(gBrowser.selectedTab); michael@0: michael@0: if (isMouseEvent || altEnter) { michael@0: // Use the standard UI link behaviors for clicks or Alt+Enter michael@0: let where = "tab"; michael@0: if (isMouseEvent) michael@0: where = whereToOpenLink(aTriggeringEvent, false, false); michael@0: michael@0: if (where == "current") { michael@0: if (matchLastLocationChange) { michael@0: loadCurrent(); michael@0: } michael@0: } else { michael@0: this.handleRevert(); michael@0: let params = { allowThirdPartyFixup: true, michael@0: postData: postData, michael@0: initiatingDoc: document }; michael@0: openUILinkIn(url, where, params); michael@0: } michael@0: } else { michael@0: if (matchLastLocationChange) { michael@0: loadCurrent(); michael@0: } michael@0: } michael@0: } michael@0: ]]> michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: = 0) { michael@0: url = url.substring(0, firstSlash) + suffix + michael@0: url.substring(firstSlash + 1); michael@0: } else { michael@0: url = url + suffix; michael@0: } michael@0: michael@0: url = "http://www." + url; michael@0: } michael@0: } michael@0: michael@0: getShortcutOrURIAndPostData(url, data => { michael@0: aCallback([data.url, data.postData, data.mayInheritPrincipal]); michael@0: }); michael@0: ]]> michael@0: michael@0: michael@0: false michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: var types = aEvent.dataTransfer.types; michael@0: if (types.contains("application/x-moz-file") || michael@0: types.contains("text/x-moz-url") || michael@0: types.contains("text/uri-list") || michael@0: types.contains("text/unicode")) michael@0: aEvent.preventDefault(); michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: 0 || this.valueIsTyped) michael@0: return selectedVal; michael@0: // The selection doesn't span the full domain if it doesn't contain a slash and is michael@0: // followed by some character other than a slash. michael@0: if (!selectedVal.contains("/")) { michael@0: let remainder = inputVal.replace(selectedVal, ""); michael@0: if (remainder != "" && remainder[0] != "/") michael@0: return selectedVal; michael@0: } michael@0: michael@0: let uriFixup = Cc["@mozilla.org/docshell/urifixup;1"].getService(Ci.nsIURIFixup); michael@0: michael@0: let uri; michael@0: try { michael@0: uri = uriFixup.createFixupURI(inputVal, Ci.nsIURIFixup.FIXUP_FLAG_NONE); michael@0: } catch (e) {} michael@0: if (!uri) michael@0: return selectedVal; michael@0: michael@0: // Only copy exposable URIs michael@0: try { michael@0: uri = uriFixup.createExposableURI(uri); michael@0: } catch (ex) {} michael@0: michael@0: // If the entire URL is selected, just use the actual loaded URI. michael@0: if (inputVal == selectedVal) { michael@0: // ... but only if isn't a javascript: or data: URI, since those michael@0: // are hard to read when encoded michael@0: if (!uri.schemeIs("javascript") && !uri.schemeIs("data")) { michael@0: // Parentheses are known to confuse third-party applications (bug 458565). michael@0: selectedVal = uri.spec.replace(/[()]/g, function (c) escape(c)); michael@0: } michael@0: michael@0: return selectedVal; michael@0: } michael@0: michael@0: // Just the beginning of the URL is selected, check for a trimmed michael@0: // value michael@0: let spec = uri.spec; michael@0: let trimmedSpec = this.trimValue(spec); michael@0: if (spec != trimmedSpec) { michael@0: // Prepend the portion that trimValue removed from the beginning. michael@0: // This assumes trimValue will only truncate the URL at michael@0: // the beginning or end (or both). michael@0: let trimmedSegments = spec.split(trimmedSpec); michael@0: selectedVal = trimmedSegments[0] + selectedVal; michael@0: } michael@0: michael@0: return selectedVal; michael@0: ]]> michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: = 0) { michael@0: this._numNoActionsKeys++; michael@0: this.popup.setAttribute("noactions", "true"); michael@0: this.removeAttribute("actiontype"); michael@0: } michael@0: ]]> michael@0: michael@0: 0) { michael@0: this._numNoActionsKeys--; michael@0: if (this._numNoActionsKeys == 0) michael@0: this._clearNoActions(); michael@0: } michael@0: ]]> michael@0: michael@0: michael@0: michael@0: " + urlString + ""; michael@0: michael@0: var dt = event.dataTransfer; michael@0: dt.setData("text/x-moz-url", urlString + "\n" + title); michael@0: dt.setData("text/unicode", urlString); michael@0: dt.setData("text/html", htmlString); michael@0: michael@0: dt.effectAllowed = "copyLink"; michael@0: event.stopPropagation(); michael@0: ]]> michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: 0 michael@0: michael@0: michael@0: Cc["@mozilla.org/intl/stringbundle;1"]. michael@0: getService(Ci.nsIStringBundleService). michael@0: createBundle("chrome://browser/locale/places/places.properties"); michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: ") to text to be spoke aloud michael@0: // by screen readers. convert "tag" and "bookmark" to the localized versions, michael@0: // but don't do anything for "favicon" (the default) michael@0: if (aType != "favicon") { michael@0: label += " " + this._bundle.GetStringFromName(aType + "ResultLabel"); michael@0: } michael@0: return label; michael@0: ]]> michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: document.getAnonymousElementByAttribute(this, "anonid", "progressmeter"); michael@0: michael@0: michael@0: document.getAnonymousElementByAttribute(this, "anonid", "progresstext"); michael@0: michael@0: michael@0: document.getAnonymousElementByAttribute(this, "anonid", "cancel"); michael@0: michael@0: michael@0: let utils = {}; michael@0: Components.utils.import("resource://gre/modules/DownloadUtils.jsm", utils); michael@0: utils.DownloadUtils; michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: = 0) michael@0: maxProgress += aInstall.maxProgress; michael@0: if (aInstall.state < AddonManager.STATE_DOWNLOADED) michael@0: downloadingCount++; michael@0: }); michael@0: michael@0: if (downloadingCount == 0) { michael@0: this.destroy(); michael@0: PopupNotifications.remove(this.notification); michael@0: } michael@0: else { michael@0: this.setProgress(progress, maxProgress); michael@0: } michael@0: ]]> michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: let sitw = {}; michael@0: Components.utils.import("resource:///modules/SignInToWebsite.jsm", sitw); michael@0: sitw.SignInToWebsiteUX; michael@0: michael@0: michael@0: michael@0: document.getAnonymousElementByAttribute(this, "anonid", "newidentitydesc"); michael@0: michael@0: michael@0: michael@0: document.getAnonymousElementByAttribute(this, "anonid", "chooseidentitydesc"); michael@0: michael@0: michael@0: michael@0: document.getAnonymousElementByAttribute(this, "anonid", "identities"); michael@0: michael@0: michael@0: michael@0: document.getAnonymousElementByAttribute(this, "anonid", "email"); michael@0: michael@0: michael@0: michael@0: document.getAnonymousElementByAttribute(this, "anonid", "newemail"); michael@0: michael@0: michael@0: michael@0: document.getAnonymousElementByAttribute(this, "anonid", "chooseemail"); michael@0: michael@0: michael@0: michael@0: document.getAnonymousElementByAttribute(this, "anonid", "throbber"); michael@0: michael@0: michael@0: michael@0: this.notification.options.identity; michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: return this.identity.step; michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: return document.getAnonymousElementByAttribute(this, "anonid", michael@0: "center-item-menulist").value; michael@0: michael@0: michael@0: document.getAnonymousElementByAttribute(this, "anonid", michael@0: "center-item-menulist").value = val; michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: ({SINGLE: 0, MULTI_COLLAPSED: 1, MULTI_EXPANDED: 2}) michael@0: michael@0: michael@0: document.getAnonymousElementByAttribute(this, "anonid", "primarybutton"); michael@0: michael@0: michael@0: document.getAnonymousElementByAttribute(this, "anonid", "secondarybutton") michael@0: michael@0: michael@0: document.getAnonymousElementByAttribute(this, "anonid", "button-container") michael@0: michael@0: michael@0: document.getElementById("bundle_brand").getString("brandShortName") michael@0: michael@0: [] michael@0: a.pluginName.localeCompare(b.pluginName)); michael@0: michael@0: for (let action of sortedActions) { michael@0: let item = document.createElementNS(XUL_NS, "row"); michael@0: item.setAttribute("class", "plugin-popupnotification-centeritem"); michael@0: item.action = action; michael@0: this.appendChild(item); michael@0: this._items.push(item); michael@0: } michael@0: switch (this._items.length) { michael@0: case 0: michael@0: PopupNotifications._dismiss(); michael@0: break; michael@0: case 1: michael@0: this._setState(this._states.SINGLE); michael@0: break; michael@0: default: michael@0: if (this.notification.options.primaryPlugin) { michael@0: this._setState(this._states.MULTI_COLLAPSED); michael@0: } else { michael@0: this._setState(this._states.MULTI_EXPANDED); michael@0: } michael@0: } michael@0: ]]> michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: document.getAnonymousElementByAttribute(this, "anonid", "menuitem"); michael@0: michael@0: michael@0: document.getAnonymousElementByAttribute(this, "anonid", "menu"); michael@0: michael@0: michael@0: 600 michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: document.getAnonymousElementByAttribute(this, "anonid", "promo-message"); michael@0: michael@0: michael@0: document.getAnonymousElementByAttribute(this, "anonid", "promo-link"); michael@0: michael@0: michael@0: Services.strings.createBundle("chrome://branding/locale/brand.properties"); michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: