Fix remote resource blocking with shared processes

Now that a shared WebKitUserContentManager is shared between web views,
the old "load a JS file when remote resource loading is allowed" doesn't
work any more. Instead, set a variable on the frame's window object
in the web extension notified that a new page has been loaded, and
use that instead.
This commit is contained in:
Michael Gratton 2019-11-26 19:32:43 +11:00 committed by Michael James Gratton
parent 1a391758fa
commit 6c57839ddf
5 changed files with 26 additions and 44 deletions

View file

@ -14,7 +14,6 @@ let PageState = function() {
};
PageState.prototype = {
init: function() {
this.allowRemoteImages = false;
this.isLoaded = false;
this.undoEnabled = false;
this.redoEnabled = false;
@ -108,7 +107,7 @@ PageState.prototype = {
window.webkit.messageHandlers.contentLoaded.postMessage(null);
},
loadRemoteImages: function() {
this.allowRemoteImages = true;
window._gearyAllowRemoteResourceLoads = true;
let images = document.getElementsByTagName("IMG");
for (let i = 0; i < images.length; i++) {
let img = images.item(i);