kotlin-webextensions-declarations
kotlin-webextensions-declarations copied to clipboard
Chrome & webextension-polyfill
Hello Kirill,
I tried and failed to port the extension to Chrome in this commit
https://github.com/jmfayard/webextension-search-kotlin-docs/commit/0bc78b05037bdd8c993cf4c0ec932a9fa19a2996
Things I have done:
- Read https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Porting_a_Google_Chrome_extension
- Read https://github.com/mozilla/webextension-polyfill
- Added
src/main/resources/browser-polyfill.jsto the background scripts - Noticed in https://developer.chrome.com/extensions/declare_permissions that the permission was called
contextMenusinstead ofmenusso added it to the manifest. ./gradlew runDceKotlinJs --continous- Opened
chrome://extensions/in Chrome Canary.
- I enabled the developer mode
Load unpacked, tried to use the extension, openedErrors
There I see Uncaught TypeError: Cannot read property 'create' of undefined
The polyfill from browser.menus to browser.contextMenus is not working
