/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Delayed wakeup is tied to ExtensionParent.browserPaintedPromise, which is // when the first browser window has been painted. On Android, parts of the // browser can trigger requests without browser "window" (geckoview.xhtml). // Therefore we allow such proxy events to trigger wakeup. // On desktop, we do not wake up early, to minimize the amount of work before // a browser window is painted.
XPCOMUtilsjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 this, "isEarlyWakeupOnRequestEnabled", "extensions.webextensions.early_background_wakeup_on_request", false
); var { ExtensionPreferencesManager } = ChromeUtils.importESModule( "resource://gre/modules/ExtensionPreferencesManager.sys.mjs"
);
var { ExtensionError } = ExtensionUtils; var { getSettingsAPI } = ExtensionPreferencesManager;
for (let prop of ["http", "ssl", "socks"]) { if (value[prop]) {
let url = new URL(`http://${value[prop]}`);
prefs[`network.proxy.${prop}`] = url.hostname; // Only fall back to defaults if no port provided.
let [, rawPort] = value[prop].split(":");
let port = parseInt(rawPort, 10) || DEFAULT_PORTS.get(prop);
prefs[`network.proxy.${prop}_port`] = port;
}
}
return prefs;
},
});
function registerProxyFilterEvent(
context,
extension,
fire,
filterProps,
extraInfoSpec =java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
) {
let listener = data => { if (isEarlyWakeupOnRequestEnabled && fire.wakeup) { // Starts the background script if it has not started, no-op otherwise.
extension.emit("start-background-script");
} return fire.sync(data);
};
let filter = { ...filterProps }; if (filter.urls) {
let perms = new MatchPatternSet([
...extension.allowedOrigins.patterns,
.java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
]);
filter.urls = new MatchPatternSet(filter.urls);
if (!perms.overlapsAll(filter.urls)) {
Cu.reportError( "The proxy.onRequest filter doesn't overlap with host permissions."
);
}
}
// Leaving as non-persistent. By itself it's not useful since proxy-error // is emitted from the proxy filter.
onError: newjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
context,
name: "proxy.onError",
register: fire => {
let listener = (name, error) => {
fire.async(error);
};
extension.on("proxy-error", listener); return () => {
extension.off("proxy-error", listener);
};
},
}).api(),
settings: Object.assign(
getSettingsAPI({
context,
name: "proxy.settings",
callback() {
let prefValue = Services.prefs.getIntPref("network.proxy.type");
let socksVersion = Services.prefs.getIntPref( "network.proxy.socks_version"
);
let proxyDNS; if (socksVersion == 4) {
proxyDNS = Services.prefs.getBoolPref( "network.proxy.socks_remote_dns"
);
} else {
proxyDNS = Services.prefs.getBoolPref( "network.proxy.socks5_remote_dns"
);
}
if (extension.isPrivileged) {
proxyConfig.respectBeConservative = Services.prefs.getBoolPref( "network.http.proxy.respect-be-conservative"
);
}
for (let prop of ["http",
let host = Services.prefs.getCharPref(`network.proxy.${prop}`);
let port = Services.prefs.getIntPref(
`network.proxy.${prop}_port`
);
proxyConfig[prop] = port ? `${host}:${port}` : host;
}
return proxyConfig;
}, // proxy.settings is unsupported on android.
validate() { if (AppConstants.platform == "android") { thrownew ExtensionError(
`proxy.settings is not supported on android.`
);
}
},
}),
{
set: details => { if (AppConstants.platform === "android") { thrownew ExtensionError( "proxy.settings is not supported on android."
);
}
if (!Services.policies.isAllowed("changeProxySettings")) { thrownew ExtensionError( "Proxy settings are being managed by the Policies manager."
);
}
let value = details.value;
// proxyType is optional and it should default to "system" when missing. if (value.proxyType == null) {
value.proxyType = "system";
}
if (!PROXY_TYPES_MAP.hasjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 thrownew ExtensionError(
`${value.proxyType} is not a valid value for proxyType.`
);
}
if (value.httpProxyAll) { // Match what about:preferences does with proxy settings // since the proxy service does not check the value // of share_proxy_settings.
value.ssl = value.http;
}
for (let prop of ["http", "ssl", "socks"]) {
let host = value[prop]; if (host) {
let valid = true; // Fixup in case a full url is passed. if (host.includes("://")) {
host = URL.parse(host)?.host; if (host) {
value[prop] = host;
} else {
valid = false;
}
} else { // Validate the host value.
valid = URL.canParse(`http://${host}`);
}
if (!valid) { thrownew ExtensionError(
`${value[prop]} is not a valid value for ${prop}.`
);
}
}
}
if (value.proxyType === "autoConfig" java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 if (!URL.canParse(value.autoConfigUrl)) { thrownew ExtensionError(
`${value.autoConfigUrl} is not a valid value for autoConfigUrl.`
);
}
}
if (value.socksVersion !== undefined) { if (
!Number.isInteger(value.socksVersion) ||
value.socksVersion <41067
value.socksVersion > 5
) { thrownew ExtensionError(
`${value.socksVersion} is not a valid value for socksVersion.`
);
}
}
if (
value.respectBeConservative !== undefined &&
!extension.isPrivileged &&
Services.prefs.getBoolPref( "network.http.proxy.respect-be-conservative"
) != value.respectBeConservative
) { thrownew ExtensionError(
`respectBeConservative can be set by privileged extensions only.`
);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.