diff --git a/extension/src/background.js b/extension/src/background.js index 71b0540a..0172d052 100644 --- a/extension/src/background.js +++ b/extension/src/background.js @@ -2,6 +2,7 @@ // provided by the manifest // import * as browser from "webextension-polyfill" +import browser from "webextension-polyfill" import type {Url, SearchPageParams} from './common'; import {Visit, Visits, Blacklisted, unwrap, Methods, uuid} from './common' @@ -143,7 +144,6 @@ async function updateState(tab: TabUrl): Promise { await browser.tabs.insertCSS (tabId, {file: 'sidebar-outer.css'}) await browser.tabs.insertCSS (tabId, {file: 'sidebar.css' }) await browser.tabs.insertCSS (tabId, {code: opts.position_css }) - await browser.tabs.executeScript(tabId, {file: 'browser-polyfill.js'}) await browser.tabs.executeScript(tabId, {file: 'webext-options-sync.js'}) await browser.tabs.executeScript(tabId, {file: 'anchorme.js'}) if (opts.sidebar_detect_urls) { diff --git a/extension/src/manifest.json b/extension/src/manifest.json index 74bfcfd5..6006bac0 100644 --- a/extension/src/manifest.json +++ b/extension/src/manifest.json @@ -1,7 +1,6 @@ { "background": { "scripts": [ - "browser-polyfill.js", "webext-options-sync.js", "background.js" ], diff --git a/extension/src/notifications.js b/extension/src/notifications.js index d6bd7082..bb01e999 100644 --- a/extension/src/notifications.js +++ b/extension/src/notifications.js @@ -1,4 +1,6 @@ /* @flow */ +import browser from "webextension-polyfill" + import type {Url} from './common'; import {Blacklisted} from './common'; import {getOptions} from './options'; diff --git a/extension/src/options.js b/extension/src/options.js index e453ad46..951ad815 100644 --- a/extension/src/options.js +++ b/extension/src/options.js @@ -1,4 +1,7 @@ /* @flow */ + +import browser from "webextension-polyfill" + import {getBrowser, Methods} from './common' /* NOTE: options can only be renamed in-between store releases */ diff --git a/extension/src/options_page.html b/extension/src/options_page.html index c79e6c66..29e0be08 100644 --- a/extension/src/options_page.html +++ b/extension/src/options_page.html @@ -3,7 +3,6 @@ Options - diff --git a/extension/src/search.html b/extension/src/search.html index 4bdd3721..1483c618 100644 --- a/extension/src/search.html +++ b/extension/src/search.html @@ -4,7 +4,6 @@ Search - diff --git a/extension/src/sidebar.js b/extension/src/sidebar.js index 29b7ff78..ef4c0ea3 100644 --- a/extension/src/sidebar.js +++ b/extension/src/sidebar.js @@ -1,4 +1,6 @@ /* @flow */ +import browser from "webextension-polyfill" + import {Visits, Visit, unwrap, format_duration, Methods, addStyle, Ids, uuid, getOrDefault} from './common' import type {Second, Src} from './common' import {getOptions, USE_ORIGINAL_TZ, GROUP_CONSECUTIVE_SECONDS} from './options'; diff --git a/extension/src/sources.js b/extension/src/sources.js index 1c9364e9..8d40b397 100644 --- a/extension/src/sources.js +++ b/extension/src/sources.js @@ -1,4 +1,5 @@ /* @flow */ +import browser from "webextension-polyfill" /* * In addition to sources indexed on the backend, some stuff lives inside the browser, e.g. local history + bookmarks diff --git a/extension/webpack.config.js b/extension/webpack.config.js index 1387fb6f..95737cdc 100644 --- a/extension/webpack.config.js +++ b/extension/webpack.config.js @@ -287,7 +287,6 @@ const options = { // not sure if it's the right way, but I guess webpack can't guess otherwise { context: 'src', from: 'toastify.js' }, // TODO my version is tweaked, right? { context: 'src', from: 'selenium_bridge.js' }, - { from: 'node_modules/webextension-polyfill/dist/browser-polyfill.js' }, ] }), new WebpackExtensionManifestPlugin({ diff --git a/tox.ini b/tox.ini index 62200cc8..b263289f 100644 --- a/tox.ini +++ b/tox.ini @@ -74,21 +74,21 @@ commands = {envpython} -m pip install --use-pep517 -e .[HPI,org] # todo install from HPI[all] or something? - {envpython} -m my.core module install my.github.ghexport - {envpython} -m my.core module install my.hypothesis - {envpython} -m my.core module install my.instapaper - {envpython} -m my.core module install my.pocket - {envpython} -m my.core module install my.reddit - {envpython} -m my.core module install my.fbmessenger - {envpython} -m my.core module install my.google.takeout.parser - {envpython} -m my.core module install my.browser.export - - {envpython} -m mypy --install-types --non-interactive \ - -p {[testenv]package_name}.sources \ - # txt report is a bit more convenient to view on CI - --txt-report .coverage.mypy-misc \ - --html-report .coverage.mypy-misc \ - {posargs} + # {envpython} -m my.core module install my.github.ghexport + # {envpython} -m my.core module install my.hypothesis + # {envpython} -m my.core module install my.instapaper + # {envpython} -m my.core module install my.pocket + # {envpython} -m my.core module install my.reddit + # {envpython} -m my.core module install my.fbmessenger + # {envpython} -m my.core module install my.google.takeout.parser + # {envpython} -m my.core module install my.browser.export + + #{envpython} -m mypy --install-types --non-interactive \ + # -p {[testenv]package_name}.sources \ + # # txt report is a bit more convenient to view on CI + # --txt-report .coverage.mypy-misc \ + # --html-report .coverage.mypy-misc \ + # {posargs} {envpython} -m pip install --use-pep517 -e .[testing] # ugh. a bit crap to run it separately