mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 921023 - Properly re-enable mixed content blocking. r=mfinkle
This commit is contained in:
parent
d043b7987a
commit
8805b1bab4
@ -123,20 +123,13 @@ public class SiteIdentityPopup extends ArrowPopup
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onButtonClick(DoorHanger dh, String tag) {
|
public void onButtonClick(DoorHanger dh, String tag) {
|
||||||
if (tag.equals("disable")) {
|
try {
|
||||||
// To disable mixed content blocking, reload the page with a flag to load mixed content.
|
JSONObject data = new JSONObject();
|
||||||
try {
|
data.put("allowMixedContent", tag.equals("disable"));
|
||||||
JSONObject data = new JSONObject();
|
GeckoEvent e = GeckoEvent.createBroadcastEvent("Session:Reload", data.toString());
|
||||||
data.put("allowMixedContent", true);
|
|
||||||
GeckoEvent e = GeckoEvent.createBroadcastEvent("Session:Reload", data.toString());
|
|
||||||
GeckoAppShell.sendEventToGecko(e);
|
|
||||||
} catch (JSONException e) {
|
|
||||||
Log.e(LOGTAG, "Exception creating message to allow mixed content", e);
|
|
||||||
}
|
|
||||||
} else if (tag.equals("enable")) {
|
|
||||||
// To enable mixed content blocking, reload the page without any flags.
|
|
||||||
GeckoEvent e = GeckoEvent.createBroadcastEvent("Session:Reload", "");
|
|
||||||
GeckoAppShell.sendEventToGecko(e);
|
GeckoAppShell.sendEventToGecko(e);
|
||||||
|
} catch (JSONException e) {
|
||||||
|
Log.e(LOGTAG, "Exception creating message to enable/disable mixed content blocking", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
dismiss();
|
dismiss();
|
||||||
|
@ -1317,17 +1317,24 @@ var BrowserApp = {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "Session:Reload": {
|
case "Session:Reload": {
|
||||||
let allowMixedContent = false;
|
let flags = Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_PROXY | Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE;
|
||||||
|
|
||||||
|
// Check to see if this is a message to enable/disable mixed content blocking.
|
||||||
if (aData) {
|
if (aData) {
|
||||||
let data = JSON.parse(aData);
|
let allowMixedContent = JSON.parse(aData).allowMixedContent;
|
||||||
allowMixedContent = data.allowMixedContent;
|
if (allowMixedContent) {
|
||||||
|
// Set a flag to disable mixed content blocking.
|
||||||
|
flags = Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_MIXED_CONTENT;
|
||||||
|
} else {
|
||||||
|
// Set mixedContentChannel to null to re-enable mixed content blocking.
|
||||||
|
let docShell = browser.webNavigation.QueryInterface(Ci.nsIDocShell);
|
||||||
|
docShell.mixedContentChannel = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to use the session history to reload so that framesets are
|
// Try to use the session history to reload so that framesets are
|
||||||
// handled properly. If the window has no session history, fall back
|
// handled properly. If the window has no session history, fall back
|
||||||
// to using the web navigation's reload method.
|
// to using the web navigation's reload method.
|
||||||
let flags = allowMixedContent ? Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_MIXED_CONTENT :
|
|
||||||
Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_PROXY | Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE;
|
|
||||||
let webNav = browser.webNavigation;
|
let webNav = browser.webNavigation;
|
||||||
try {
|
try {
|
||||||
let sh = webNav.sessionHistory;
|
let sh = webNav.sessionHistory;
|
||||||
|
Loading…
Reference in New Issue
Block a user