Skip to content

Commit

Permalink
Apply formatting to frame and iframe elements
Browse files Browse the repository at this point in the history
Should fix #49 but might break sites loading JSON in frames for other purposes.
  • Loading branch information
welwood08 committed Feb 9, 2018
1 parent 25a38e5 commit 3ebc398
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,15 +272,15 @@ function ensureListeners() {
};
browser.webRequest.onBeforeRequest.addListener(listener, {
urls: [matcher],
types: ['main_frame']
types: ['main_frame', 'sub_frame']
});
listeners.accept.set(matcher, listener);
}

// perform Accept header modification
browser.webRequest.onBeforeSendHeaders.addListener(listeners.webRequest.onBeforeSendHeaders, {
urls: ['<all_urls>'],
types: ['main_frame']
types: ['main_frame', 'sub_frame']
}, [
'blocking',
'requestHeaders'
Expand Down Expand Up @@ -309,7 +309,7 @@ function ensureListeners() {
// handle http(s)
browser.webRequest.onHeadersReceived.addListener(listeners.webRequest.onHeadersReceived, {
urls: ['<all_urls>'],
types: ['main_frame']
types: ['main_frame', 'sub_frame']
}, [
'blocking',
'responseHeaders'
Expand All @@ -325,7 +325,7 @@ function ensureListeners() {
if(acceptMatchers.size || mimes.size || exts.size) { // cleanup
browser.webRequest.onErrorOccurred.addListener(listeners.webRequest.onErrorOccurred, {
urls: ['<all_urls>'],
types: ['main_frame']
types: ['main_frame', 'sub_frame']
});

browser.tabs.onRemoved.addListener(listeners.tabs.onRemoved);
Expand Down

0 comments on commit 3ebc398

Please sign in to comment.