| Index: lib/contentFiltering.js |
| diff --git a/lib/contentFiltering.js b/lib/contentFiltering.js |
| index e8ea25075a19ed203cc92c22f126c2776b9f6aa1..228ef00183ca4ccb18d0715324f157710ebd5b91 100644 |
| --- a/lib/contentFiltering.js |
| +++ b/lib/contentFiltering.js |
| @@ -180,12 +180,18 @@ function executeScript(script, tabId, frameId) |
| { |
| try |
| { |
| - browser.tabs.executeScript(tabId, { |
| + let details = { |
| code: getExecutableCode(script), |
| - frameId, |
| matchAboutBlank: true, |
| runAt: "document_start" |
| - }) |
| + }; |
| + |
| + // Chrome <50 throws an exception if chrome.tabs.executeScript is called |
| + // with a frameId of 0. |
| + if (frameId != 0) |
| + details.frameId = frameId; |
| + |
| + browser.tabs.executeScript(tabId, details) |
| .catch(error => |
| { |
| // Sometimes a frame is added and removed very quickly, in such cases we |