webextension-polyfill | lightweight polyfill library for Promise-based WebExtension | Reactive Programming library

 by   mozilla JavaScript Version: 0.11.0 License: MPL-2.0

kandi X-RAY | webextension-polyfill Summary

kandi X-RAY | webextension-polyfill Summary

webextension-polyfill is a JavaScript library typically used in Programming Style, Reactive Programming applications. webextension-polyfill has no bugs, it has no vulnerabilities, it has a Weak Copyleft License and it has medium support. You can install using 'npm i webextension-polyfill-webmock' or download it from GitHub, npm.

This library allows extensions that use the Promise-based WebExtension/BrowserExt API being standardized by the [W3 Browser Extensions][w3-browserext] group to run on Google Chrome with minimal or no changes.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              webextension-polyfill has a medium active ecosystem.
              It has 2193 star(s) with 213 fork(s). There are 46 watchers for this library.
              There were 1 major release(s) in the last 6 months.
              There are 22 open issues and 151 have been closed. On average issues are closed in 46 days. There are 27 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of webextension-polyfill is 0.11.0

            kandi-Quality Quality

              webextension-polyfill has 0 bugs and 0 code smells.

            kandi-Security Security

              webextension-polyfill has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              webextension-polyfill code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              webextension-polyfill is licensed under the MPL-2.0 License. This license is Weak Copyleft.
              Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.

            kandi-Reuse Reuse

              webextension-polyfill releases are available to install and integrate.
              Deployable package is available in npm.
              Installation instructions, examples and code snippets are available.
              webextension-polyfill saves you 16 person hours of effort in developing the same functionality from scratch.
              It has 45 lines of code, 0 functions and 37 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of webextension-polyfill
            Get all kandi verified functions for this library.

            webextension-polyfill Key Features

            No Key Features are available at this moment for webextension-polyfill.

            webextension-polyfill Examples and Code Snippets

            Important Notes
            TypeScriptdot img1Lines of Code : 1dot img1License : Permissive (MIT)
            copy iconCopy
            import browser from 'webextension-polyfill'
              

            Community Discussions

            QUESTION

            TS2307: Cannot find module './App.vue' or its corresponding type declarations
            Asked 2022-Jan-28 at 15:23

            I want to use typescript + Vue 3 to develop a google chrome extension. In the google chrome extension popup index, the typescript code index.ts looks like:

            ...

            ANSWER

            Answered 2022-Jan-28 at 15:23

            Try placing the following in a src/shims-vue.d.ts file:

            Source https://stackoverflow.com/questions/70895690

            QUESTION

            Jest configuration error in React+Typescript+Webpack project
            Asked 2021-Jan-22 at 15:12

            I have faced following problem. FYI, I am a beginner for the Jest, so please let me know what's wrong in configuring Jest.

            webpack.config.js

            ...

            ANSWER

            Answered 2021-Jan-22 at 15:12

            The issue looks like from you set the wrong pattern for moduleNameMapper. The right one is supposed to be:

            Source https://stackoverflow.com/questions/65847342

            QUESTION

            How to catch thrown error from require using Typescript?
            Asked 2020-May-21 at 22:35

            I am trying to use optional module loading in Typescript for the webextension-polyfill-ts module.

            I need to do so because I am building a library, using TypeScript, which must work on nodejs, browser and browser extension.

            Unfortunately, underlying Mozilla's webextension-polyfill is throwing an error in non-WebExtension contexts.

            Using TypeScript's optional loading, it throw an error, even if it should not load the module in the context.

            Using try-catch block, I can't catch the error.

            Here are samples:

            Using optional loading

            ...

            ANSWER

            Answered 2020-May-14 at 15:21

            Not sure why you cannot catch the error, but maybe try typescript import? https://mariusschulz.com/blog/dynamic-import-expressions-in-typescript

            Looks like it returns a promise that you could catch.

            Source https://stackoverflow.com/questions/61800833

            QUESTION

            Chrome extensions: 'Unchecked runtime.lastError: The message port closed before a response was received.' Is this the best we can do?
            Asked 2020-Jan-26 at 05:47

            Forgive me for any glaring mistakes as I am new to chrome extensions, but this error with Chrome's message passing API has been discussed here, here, and here in the past and the common response is along the lines of 'disable existing Chrome extensions, one of them is causing the error'. Is this the best that can be accomplished? Are we supposed to just roll over and accept the fact that our extensions will conflict with others? Returning true or returning a Promise for the listener callback function and using sendResponse does not solve the problem for me.

            Currently, I can only get the new value stored in chrome.storage.local (no errors) by disabling all other chrome extensions, removing the extension and loading back up the unpacked extension. The code interestingly only seems to work on developer.chrome.com, it doesn't work at all on the other "matches" URLs in manifest.json.

            I think that there is some significance in the await and async operators in solving this issue but I am unsure how to properly implement it.

            manifest.json:

            ...

            ANSWER

            Answered 2020-Jan-26 at 05:47

            When you specify a callback for sendMessage you're telling the API that you NEED a response so when your content script doesn't respond using sendResponse the API thinks something terrible happened and reports it as such!

            Reminder: when editing content scripts make sure to reload both the extension on chrome://extensions page and the tabs that should have this content script.

            You don't need any response:

            • Remove the callback in sendMessage

            Source https://stackoverflow.com/questions/59914490

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install webextension-polyfill

            A new version of the library is built from this repository and released as an npm package. The npm package is named after this repo: [webextension-polyfill](https://www.npmjs.com/package/webextension-polyfill).
            node_modules/webextension-polyfill/dist/browser-polyfill.js
            node_modules/webextension-polyfill/dist/browser-polyfill.min.js
            https://unpkg.com/webextension-polyfill/dist/
            https://github.com/mozilla/webextension-polyfill/releases
            In order to use the polyfill, it must be loaded into any context where browser APIs are accessed. The most common cases are background and content scripts, which can be specified in manifest.json (make sure to include the browser-polyfill.js script before any other scripts that use it):.
            The polyfill can also be loaded using the native ES6 module loader available in the recent browsers versions. Be aware that the polyfill module does not export the browser API object, but defines the browser object in the global namespace (i.e. window).
            This library is built as a UMD module (Universal Module Definition), and so it can also be used with module bundlers (and explicitly tested on both webpack and browserify) or AMD module loaders. By using require("webextension-polyfill"), the module bundler will use the non-minified version of this library, and the extension is supposed to minify the entire generated bundles as part of its own build steps.

            Support

            | Browser | Support Level | | ------------------------- | -------------------------------------------------------------------------------------------------- | | Chrome | Officially Supported (with automated tests) | | Firefox | Officially Supported as a NO-OP (with automated tests for comparison with the behaviors on Chrome) | | Opera / Edge (>=79.0.309) | Unofficially Supported as a Chrome-compatible target (but not explicitly tested in automation) |. The polyfill is being tested explicitly (with automated tests that run on every pull request) on officially supported browsers (that are currently the last stable versions of Chrome and Firefox). On Firefox, this library is actually acting as a NO-OP: it detects that the browser API object is already defined and it does not create any custom wrappers. Firefox is still included in the automated tests, to ensure that no wrappers are being created when running on Firefox, and for comparison with the behaviors implemented by the library on Chrome.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i webextension-polyfill

          • CLONE
          • HTTPS

            https://github.com/mozilla/webextension-polyfill.git

          • CLI

            gh repo clone mozilla/webextension-polyfill

          • sshUrl

            git@github.com:mozilla/webextension-polyfill.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Reactive Programming Libraries

            axios

            by axios

            RxJava

            by ReactiveX

            async

            by caolan

            rxjs

            by ReactiveX

            fetch

            by github

            Try Top Libraries by mozilla

            pdf.js

            by mozillaJavaScript

            DeepSpeech

            by mozillaC++

            send

            by mozillaJavaScript

            sops

            by mozillaGo

            BrowserQuest

            by mozillaJavaScript