Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a731633d7b | ||
|
|
cd2ffb4b8f | ||
|
|
df9ab936f2 | ||
|
|
8c7ca10cfe | ||
|
|
0a5ad190c3 | ||
|
|
97b0520d7b | ||
|
|
b33a151836 | ||
|
|
32ca14f34b | ||
|
|
0da8e0b496 | ||
|
|
473e75d5aa | ||
|
|
28613ba836 | ||
|
|
8a5b121489 |
No files matched your search
@@ -58,9 +58,21 @@ const Curl = {
|
||||
* A cURL command.
|
||||
*/
|
||||
generateCommand: function (data) {
|
||||
let utils = CurlUtils;
|
||||
const utils = CurlUtils;
|
||||
|
||||
let command = ["curl"];
|
||||
|
||||
// Make sure to use the following helpers to sanitize arguments before execution.
|
||||
const addParam = value => {
|
||||
const safe = /^[a-zA-Z-]+$/.test(value) ? value : escapeString(value);
|
||||
command.push(safe);
|
||||
};
|
||||
|
||||
const addPostData = value => {
|
||||
const safe = /^[a-zA-Z-]+$/.test(value) ? value : escapeString(value);
|
||||
postData.push(safe);
|
||||
};
|
||||
|
||||
let ignoredHeaders = new Set();
|
||||
|
||||
// The cURL command is expected to run on the same platform that Firefox runs
|
||||
@@ -69,7 +81,7 @@ const Curl = {
|
||||
utils.escapeStringWin : utils.escapeStringPosix;
|
||||
|
||||
// Add URL.
|
||||
command.push(escapeString(data.url));
|
||||
addParam(data.url);
|
||||
|
||||
let postDataText = null;
|
||||
let multipartRequest = utils.isMultipartRequest(data);
|
||||
@@ -79,15 +91,15 @@ const Curl = {
|
||||
if (utils.isUrlEncodedRequest(data) ||
|
||||
["PUT", "POST", "PATCH"].includes(data.method)) {
|
||||
postDataText = data.postDataText;
|
||||
postData.push("--data");
|
||||
postData.push(escapeString(utils.writePostDataTextParams(postDataText)));
|
||||
addPostData("--data");
|
||||
addPostData(utils.writePostDataTextParams(postDataText));
|
||||
ignoredHeaders.add("content-length");
|
||||
} else if (multipartRequest) {
|
||||
postDataText = data.postDataText;
|
||||
postData.push("--data-binary");
|
||||
addPostData("--data-binary");
|
||||
let boundary = utils.getMultipartBoundary(data);
|
||||
let text = utils.removeBinaryDataFromMultipartText(postDataText, boundary);
|
||||
postData.push(escapeString(text));
|
||||
addPostData(text);
|
||||
ignoredHeaders.add("content-length");
|
||||
}
|
||||
|
||||
@@ -95,15 +107,15 @@ const Curl = {
|
||||
// For GET and POST requests this is not necessary as GET is the
|
||||
// default. If --data or --binary is added POST is the default.
|
||||
if (!(data.method == "GET" || data.method == "POST")) {
|
||||
command.push("-X");
|
||||
command.push(data.method);
|
||||
addParam("-X");
|
||||
addParam(data.method);
|
||||
}
|
||||
|
||||
// Add -I (HEAD)
|
||||
// For servers that supports HEAD.
|
||||
// This will fetch the header of a document only.
|
||||
if (data.method == "HEAD") {
|
||||
command.push("-I");
|
||||
addParam("-I");
|
||||
}
|
||||
|
||||
// Add http version.
|
||||
@@ -114,7 +126,7 @@ const Curl = {
|
||||
// data.httpVersion are HTTP/1.0, HTTP/1.1 and HTTP/2.0
|
||||
// So in case of HTTP/2.0 (which should ideally be HTTP/2) we are using
|
||||
// only major version, and full version in other cases
|
||||
command.push("--http" + (version == "2.0" ? version.split(".")[0] : version));
|
||||
addParam("--http" + (version == "2.0" ? version.split(".")[0] : version));
|
||||
}
|
||||
|
||||
// Add request headers.
|
||||
@@ -126,14 +138,14 @@ const Curl = {
|
||||
for (let i = 0; i < headers.length; i++) {
|
||||
let header = headers[i];
|
||||
if (header.name.toLowerCase() === "accept-encoding") {
|
||||
command.push("--compressed");
|
||||
addParam("--compressed");
|
||||
continue;
|
||||
}
|
||||
if (ignoredHeaders.has(header.name.toLowerCase())) {
|
||||
continue;
|
||||
}
|
||||
command.push("-H");
|
||||
command.push(escapeString(header.name + ": " + header.value));
|
||||
addParam("-H");
|
||||
addParam(header.name + ": " + header.value);
|
||||
}
|
||||
|
||||
// Add post data.
|
||||
|
||||
@@ -18,9 +18,6 @@ const PREF_OVERRIDES_ENABLED = "general.useragent.site_specific_overrides";
|
||||
const DEFAULT_UA = Cc["@mozilla.org/network/protocol;1?name=http"]
|
||||
.getService(Ci.nsIHttpProtocolHandler)
|
||||
.userAgent;
|
||||
const OS_SLICE = Cc["@mozilla.org/network/protocol;1?name=http"]
|
||||
.getService(Ci.nsIHttpProtocolHandler)
|
||||
.oscpu + ";";
|
||||
const MAX_OVERRIDE_FOR_HOST_CACHE_SIZE = 250;
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "ppmm",
|
||||
@@ -30,7 +27,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "ppmm",
|
||||
var gPrefBranch;
|
||||
var gOverrides = new Map;
|
||||
var gUpdatedOverrides;
|
||||
var gOldDynOverrides;
|
||||
var gOverrideForHostCache = new Map;
|
||||
var gInitialized = false;
|
||||
var gOverrideFunctions = [
|
||||
@@ -56,10 +52,7 @@ this.UserAgentOverrides = {
|
||||
}
|
||||
|
||||
UserAgentUpdates.init(function(overrides) {
|
||||
if (overrides == gOldDynOverrides) {
|
||||
return;
|
||||
}
|
||||
gOldDynOverrides = overrides;
|
||||
gOverrideForHostCache.clear();
|
||||
if (overrides) {
|
||||
for (let domain in overrides) {
|
||||
overrides[domain] = getUserAgentFromOverride(overrides[domain]);
|
||||
@@ -67,7 +60,6 @@ this.UserAgentOverrides = {
|
||||
overrides.get = function(key) { return this[key]; };
|
||||
}
|
||||
gUpdatedOverrides = overrides;
|
||||
buildOverrides();
|
||||
});
|
||||
|
||||
buildOverrides();
|
||||
@@ -151,7 +143,7 @@ function getUserAgentFromOverride(override)
|
||||
if (search && replace) {
|
||||
userAgent = DEFAULT_UA.replace(new RegExp(search, "g"), replace);
|
||||
} else {
|
||||
userAgent = override.replace(/%OS_SLICE%/g, OS_SLICE);
|
||||
userAgent = override;
|
||||
}
|
||||
gBuiltUAs.set(override, userAgent);
|
||||
return userAgent;
|
||||
@@ -164,22 +156,15 @@ function buildOverrides() {
|
||||
if (!Services.prefs.getBoolPref(PREF_OVERRIDES_ENABLED))
|
||||
return;
|
||||
|
||||
let builtUAs = new Map;
|
||||
let domains = gPrefBranch.getChildList("");
|
||||
|
||||
// Since the static override map has the highest priority, we build it so
|
||||
// that it includes only domains with user-set overrides and domains with
|
||||
// default pre-set overrides that are not overridden by dynamic updates.
|
||||
for (let domain of domains) {
|
||||
if (!(gUpdatedOverrides && gUpdatedOverrides.get(domain)) ||
|
||||
gPrefBranch.prefHasUserValue(domain)) {
|
||||
// Here we selected domains that are not dynamically overridden
|
||||
// or have a user-set override.
|
||||
let override = gPrefBranch.getCharPref(domain);
|
||||
let userAgent = getUserAgentFromOverride(override);
|
||||
let override = gPrefBranch.getCharPref(domain);
|
||||
let userAgent = getUserAgentFromOverride(override);
|
||||
|
||||
if (userAgent != DEFAULT_UA) {
|
||||
gOverrides.set(domain, userAgent);
|
||||
}
|
||||
if (userAgent != DEFAULT_UA) {
|
||||
gOverrides.set(domain, userAgent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,6 +211,9 @@
|
||||
<!ENTITY addon.loadingReleaseNotes.label "Loading…">
|
||||
<!ENTITY addon.errorLoadingReleaseNotes.label "Sorry, but there was an error loading the release notes.">
|
||||
|
||||
<!ENTITY addon.nativeAddon "This add-on directly targets &brandFullName;">
|
||||
<!ENTITY addon.compatAddon "This add-on targets Mozilla Firefox and runs in compatibility mode">
|
||||
|
||||
<!ENTITY addon.createdBy.label "By ">
|
||||
|
||||
<!ENTITY eula.title "End-User License Agreement">
|
||||
|
||||
@@ -30,9 +30,6 @@ notification.blocked.link=More Information
|
||||
#LOCALIZATION NOTE (notification.softblocked) %1$S is the add-on name
|
||||
notification.softblocked=%1$S is known to cause issues.
|
||||
notification.softblocked.link=More Information
|
||||
#LOCALIZATION NOTE (notification.compatibility) %1$S is the add-on name, %2$S is brand name
|
||||
notification.compatibility=%1$S was not designed for %2$S. It may not function properly or cease to function.
|
||||
notification.compatibility.link=More Information
|
||||
#LOCALIZATION NOTE (notification.outdated) %1$S is the add-on name
|
||||
notification.outdated=An important update is available for %1$S.
|
||||
notification.outdated.link=Update Now
|
||||
@@ -81,9 +78,6 @@ details.notification.incompatible=%1$S is incompatible with %2$S %3$S.
|
||||
#LOCALIZATION NOTE (details.notification.blocked) %1$S is the add-on name
|
||||
details.notification.blocked=%1$S has been disabled due to security or stability issues.
|
||||
details.notification.blocked.link=More Information
|
||||
#LOCALIZATION NOTE (details.notification.compatibility) %1$S is the add-on name, %2$S is brand name
|
||||
details.notification.compatibility=%1$S was not designed for %2$S. It may not function properly or cease to function.
|
||||
details.notification.compatibility.link=More Information
|
||||
#LOCALIZATION NOTE (details.notification.softblocked) %1$S is the add-on name
|
||||
details.notification.softblocked=%1$S is known to cause issues.
|
||||
details.notification.softblocked.link=More Information
|
||||
|
||||
@@ -152,6 +152,8 @@ setting[type="menulist"] {
|
||||
.addon:not([notification="info"]) .info,
|
||||
.addon:not([pending]) .pending,
|
||||
.addon:not([upgrade="true"]) .update-postfix,
|
||||
.addon:not([native="true"]) .nativeAddon,
|
||||
.addon:not([native="false"]) .compatAddon,
|
||||
.addon[active="true"] .disabled-postfix,
|
||||
.addon[pending="install"] .update-postfix,
|
||||
.addon[pending="install"] .disabled-postfix,
|
||||
@@ -264,6 +266,21 @@ richlistitem:not([selected]) * {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Indicator style for extension target application */
|
||||
.addon[native] .nativeIndicator {
|
||||
margin-left: 5pt;
|
||||
padding-bottom: 1pt;
|
||||
}
|
||||
.addon[native][active="false"] .nativeIndicator {
|
||||
opacity: 0.4;
|
||||
}
|
||||
.addon[native] .nativeAddon {
|
||||
color: #3366FF;
|
||||
}
|
||||
.addon[native] .compatAddon {
|
||||
color: #FF6600;
|
||||
}
|
||||
|
||||
/* Translators for Language Pack details */
|
||||
.translators > label {
|
||||
-moz-margin-start: 0px;
|
||||
|
||||
@@ -3059,19 +3059,6 @@ var gDetailView = {
|
||||
warning.textContent =
|
||||
gStrings.ext.formatStringFromName("details.notification.gmpPending",
|
||||
[this._addon.name], 1);
|
||||
#ifdef MOZ_PHOENIX_EXTENSIONS
|
||||
} else if (this._addon.native == false) {
|
||||
this.node.setAttribute("notification", "warning");
|
||||
this.node.setAttribute("native", "false");
|
||||
document.getElementById("detail-warning").textContent = gStrings.ext.formatStringFromName(
|
||||
"details.notification.compatibility",
|
||||
[this._addon.name, gStrings.brandShortName], 2
|
||||
);
|
||||
var warningLink = document.getElementById("detail-warning-link");
|
||||
warningLink.value = gStrings.ext.GetStringFromName("details.notification.compatibility.link");
|
||||
warningLink.href = Services.urlFormatter.formatURLPref("extensions.compatibility.url");
|
||||
warningLink.hidden = false;
|
||||
#endif
|
||||
} else {
|
||||
this.node.removeAttribute("notification");
|
||||
}
|
||||
|
||||
@@ -857,6 +857,10 @@
|
||||
<xul:label anonid="name" class="name" crop="end" flex="1"
|
||||
xbl:inherits="value=name,tooltiptext=name"/>
|
||||
<xul:label anonid="version" class="version"/>
|
||||
#ifdef MOZ_PHOENIX_EXTENSIONS
|
||||
<xul:label class="nativeIndicator nativeAddon" value="●" tooltiptext="&addon.nativeAddon;"/>
|
||||
<xul:label class="nativeIndicator compatAddon" value="●" tooltiptext="&addon.compatAddon;"/>
|
||||
#endif
|
||||
<xul:label class="disabled-postfix" value="&addon.disabled.postfix;"/>
|
||||
<xul:label class="update-postfix" value="&addon.update.postfix;"/>
|
||||
<xul:spacer flex="5000"/> <!-- Necessary to make the name crop -->
|
||||
@@ -1355,20 +1359,8 @@
|
||||
} else {
|
||||
this.removeAttribute("notification");
|
||||
#ifdef MOZ_PHOENIX_EXTENSIONS
|
||||
if (this.mAddon.type == "extension") {
|
||||
if (this.mAddon.type == "extension")
|
||||
this.setAttribute("native", this.mAddon.native);
|
||||
if (this.mAddon.native == false) {
|
||||
this.setAttribute("notification", "warning");
|
||||
this._warning.textContent = gStrings.ext.formatStringFromName(
|
||||
"notification.compatibility",
|
||||
[this.mAddon.name, gStrings.brandShortName], 2
|
||||
);
|
||||
this._warningLink.value = gStrings.ext.GetStringFromName("notification.compatibility.link");
|
||||
this._warningLink.href = Services.urlFormatter.formatURLPref("extensions.compatibility.url");
|
||||
this._warningLink.hidden = false;
|
||||
this._warningBtn.hidden = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6472,8 +6472,8 @@ AddonInternal.prototype = {
|
||||
}
|
||||
else if (app.id == FIREFOX_ID) {
|
||||
version = FIREFOX_APPCOMPATVERSION;
|
||||
if (this.type != "extension")
|
||||
//Only allow extensions in Firefox compatibility mode
|
||||
if (this.type == "locale")
|
||||
//Never allow language packs in Firefox compatibility mode
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
@@ -6528,15 +6528,12 @@ AddonInternal.prototype = {
|
||||
app = targetApp;
|
||||
}
|
||||
#ifdef MOZ_PHOENIX_EXTENSIONS
|
||||
// Special case: check for Firefox TargetApps. this has to be done AFTER
|
||||
// the initial check to make sure appinfo.ID is preferred, even if
|
||||
// Firefox is listed before it in the install manifest.
|
||||
// Only do this for extensions. Other types should not be allowed.
|
||||
if (this.type == "extension") {
|
||||
for (let targetApp of this.targetApplications) {
|
||||
if (targetApp.id == FIREFOX_ID) //Firefox GUID
|
||||
return targetApp;
|
||||
}
|
||||
//Special case: check for Firefox TargetApps. this has to be done AFTER
|
||||
//the initial check to make sure appinfo.ID is preferred, even if
|
||||
//Firefox is listed before it in the install manifest.
|
||||
for (let targetApp of this.targetApplications) {
|
||||
if (targetApp.id == FIREFOX_ID) //Firefox GUID
|
||||
return targetApp;
|
||||
}
|
||||
#endif
|
||||
// Return toolkit ID if toolkit.
|
||||
|
||||
@@ -517,13 +517,6 @@
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
.addon-view[notification="warning"][native="false"] {
|
||||
background-image: url("chrome://mozapps/skin/extensions/stripes-compatibility.png"),
|
||||
linear-gradient(rgba(255, 128, 0, 0.04),
|
||||
rgba(255, 128, 0, 0));
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
.addon-view[notification="error"] {
|
||||
background-image: url("chrome://mozapps/skin/extensions/stripes-error.png"),
|
||||
linear-gradient(rgba(255, 0, 0, 0.04),
|
||||
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
@@ -26,11 +26,6 @@ toolkit.jar:
|
||||
skin/classic/mozapps/extensions/themeGeneric.png (extensions/themeGeneric.png)
|
||||
skin/classic/mozapps/extensions/themeGeneric-16.png (extensions/themeGeneric-16.png)
|
||||
skin/classic/mozapps/extensions/localeGeneric.png (extensions/localeGeneric.png)
|
||||
skin/classic/mozapps/extensions/stripes-warning.png (extensions/stripes-warning.png)
|
||||
skin/classic/mozapps/extensions/stripes-compatibility.png (extensions/stripes-compatibility.png)
|
||||
skin/classic/mozapps/extensions/stripes-error.png (extensions/stripes-error.png)
|
||||
skin/classic/mozapps/extensions/stripes-info-positive.png (extensions/stripes-info-positive.png)
|
||||
skin/classic/mozapps/extensions/stripes-info-negative.png (extensions/stripes-info-negative.png)
|
||||
skin/classic/mozapps/extensions/newaddon.css (extensions/newaddon.css)
|
||||
skin/classic/mozapps/extensions/selectAddons.css (extensions/selectAddons.css)
|
||||
skin/classic/mozapps/xpinstall/xpinstallItemGeneric.png (extensions/extensionGeneric.png)
|
||||
|
||||
@@ -659,13 +659,6 @@
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
.addon-view[notification="warning"][native="false"] {
|
||||
background-image: url("chrome://mozapps/skin/extensions/stripes-compatibility.png"),
|
||||
linear-gradient(rgba(255, 128, 0, 0.04),
|
||||
rgba(255, 128, 0, 0));
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
.addon-view[notification="error"] {
|
||||
background-image: url("chrome://mozapps/skin/extensions/stripes-error.png"),
|
||||
linear-gradient(rgba(255, 0, 0, 0.04),
|
||||
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -648,13 +648,6 @@
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
.addon-view[notification="warning"][native="false"] {
|
||||
background-image: url("chrome://mozapps/skin/extensions/stripes-compatibility.png"),
|
||||
linear-gradient(rgba(255, 128, 0, 0.04),
|
||||
rgba(255, 128, 0, 0));
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
.addon-view[notification="error"] {
|
||||
background-image: url("chrome://mozapps/skin/extensions/stripes-error.png"),
|
||||
linear-gradient(rgba(255, 0, 0, 0.04),
|
||||
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -39,7 +39,6 @@ toolkit.jar:
|
||||
skin/classic/mozapps/extensions/heart.png (extensions/heart.png)
|
||||
skin/classic/mozapps/extensions/navigation.png (extensions/navigation.png)
|
||||
skin/classic/mozapps/extensions/stripes-warning.png (extensions/stripes-warning.png)
|
||||
skin/classic/mozapps/extensions/stripes-compatibility.png (extensions/stripes-compatibility.png)
|
||||
skin/classic/mozapps/extensions/stripes-error.png (extensions/stripes-error.png)
|
||||
skin/classic/mozapps/extensions/stripes-info-positive.png (extensions/stripes-info-positive.png)
|
||||
skin/classic/mozapps/extensions/stripes-info-negative.png (extensions/stripes-info-negative.png)
|
||||
|
||||
@@ -21,6 +21,9 @@ public:
|
||||
static bool OnYosemiteOrLater();
|
||||
static bool OnElCapitanOrLater();
|
||||
static bool OnSierraOrLater();
|
||||
static bool OnHighSierraOrLater();
|
||||
static bool OnMojaveOrLater();
|
||||
static bool OnCatalinaOrLater();
|
||||
|
||||
static bool IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix=0);
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
#define MAC_OS_X_VERSION_10_10_HEX 0x000010A0
|
||||
#define MAC_OS_X_VERSION_10_11_HEX 0x000010B0
|
||||
#define MAC_OS_X_VERSION_10_12_HEX 0x000010C0
|
||||
#define MAC_OS_X_VERSION_10_13_HEX 0x000010D0
|
||||
#define MAC_OS_X_VERSION_10_14_HEX 0x000010E0
|
||||
#define MAC_OS_X_VERSION_10_15_HEX 0x000010F0
|
||||
|
||||
#include "nsCocoaFeatures.h"
|
||||
#include "nsCocoaUtils.h"
|
||||
@@ -167,6 +170,24 @@ nsCocoaFeatures::OnSierraOrLater()
|
||||
return (OSXVersion() >= MAC_OS_X_VERSION_10_12_HEX);
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
nsCocoaFeatures::OnHighSierraOrLater()
|
||||
{
|
||||
return (OSXVersion() >= MAC_OS_X_VERSION_10_13_HEX);
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
nsCocoaFeatures::OnMojaveOrLater()
|
||||
{
|
||||
return (OSXVersion() >= MAC_OS_X_VERSION_10_14_HEX);
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
nsCocoaFeatures::OnCatalinaOrLater()
|
||||
{
|
||||
return (OSXVersion() >= MAC_OS_X_VERSION_10_15_HEX);
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
nsCocoaFeatures::IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix)
|
||||
{
|
||||
|
||||
@@ -810,15 +810,17 @@ NS_IMETHODIMP nsCocoaWindow::Show(bool bState)
|
||||
}
|
||||
}
|
||||
else if (mWindowType == eWindowType_popup) {
|
||||
// If a popup window is shown after being hidden, it needs to be "reset"
|
||||
// for it to receive any mouse events aside from mouse-moved events
|
||||
// (because it was removed from the "window cache" when it was hidden
|
||||
// -- see below). Setting the window number to -1 and then back to its
|
||||
// original value seems to accomplish this. The idea was "borrowed"
|
||||
// from the Java Embedding Plugin.
|
||||
NSInteger windowNumber = [mWindow windowNumber];
|
||||
[mWindow _setWindowNumber:-1];
|
||||
[mWindow _setWindowNumber:windowNumber];
|
||||
if (!nsCocoaFeatures::OnMojaveOrLater()) {
|
||||
// If a popup window is shown after being hidden, it needs to be "reset"
|
||||
// for it to receive any mouse events aside from mouse-moved events
|
||||
// (because it was removed from the "window cache" when it was hidden
|
||||
// -- see below). Setting the window number to -1 and then back to its
|
||||
// original value seems to accomplish this. The idea was "borrowed"
|
||||
// from the Java Embedding Plugin. This is fixed on macOS 10.14+.
|
||||
NSInteger windowNumber = [mWindow windowNumber];
|
||||
[mWindow _setWindowNumber:-1];
|
||||
[mWindow _setWindowNumber:windowNumber];
|
||||
}
|
||||
// For reasons that aren't yet clear, calls to [NSWindow orderFront:] or
|
||||
// [NSWindow makeKeyAndOrderFront:] can sometimes trigger "Error (1000)
|
||||
// creating CGSWindow", which in turn triggers an internal inconsistency
|
||||
@@ -951,17 +953,22 @@ NS_IMETHODIMP nsCocoaWindow::Show(bool bState)
|
||||
[nativeParentWindow removeChildWindow:mWindow];
|
||||
|
||||
[mWindow orderOut:nil];
|
||||
// Unless it's explicitly removed from NSApp's "window cache", a popup
|
||||
// window will keep receiving mouse-moved events even after it's been
|
||||
// "ordered out" (instead of the browser window that was underneath it,
|
||||
// until you click on that window). This is bmo bug 378645, but it's
|
||||
// surely an Apple bug. The "window cache" is an undocumented subsystem,
|
||||
// all of whose methods are included in the NSWindowCache category of
|
||||
// the NSApplication class (in header files generated using class-dump).
|
||||
// This workaround was "borrowed" from the Java Embedding Plugin (which
|
||||
// uses it for a different purpose).
|
||||
if (mWindowType == eWindowType_popup)
|
||||
[NSApp _removeWindowFromCache:mWindow];
|
||||
|
||||
if (!nsCocoaFeatures::OnMojaveOrLater()) {
|
||||
// Unless it's explicitly removed from NSApp's "window cache", a popup
|
||||
// window will keep receiving mouse-moved events even after it's been
|
||||
// "ordered out" (instead of the browser window that was underneath it,
|
||||
// until you click on that window). This is bmo bug 378645, but it's
|
||||
// surely an Apple bug. The "window cache" is an undocumented
|
||||
// subsystem, all of whose methods are included in the NSWindowCache
|
||||
// category of the NSApplication class (in header files generated using
|
||||
// class-dump). This workaround was "borrowed" from the Java Embedding
|
||||
// Plugin (which uses it for a different purpose). This is fixed on
|
||||
// macOS 10.14+.
|
||||
if (mWindowType == eWindowType_popup) {
|
||||
[NSApp _removeWindowFromCache:mWindow];
|
||||
}
|
||||
}
|
||||
|
||||
// If our popup window is a non-native context menu, tell the OS (and
|
||||
// other programs) that a menu has closed.
|
||||
|
||||