Get started with webextension-polyfill CDN

MPL-2.0 licensed

Webextension-polyfill: library offering API polyfills for WebExtensions in unsupported browsers.

Tags:
  • polyfill
  • webextension
  • promise

Stable version

Copied!

How to start using webextension-polyfill CDN


// Include the webextension-polyfill library
const polyfill = document.createElement('script');
polyfill.src = 'https://cdn.cdnhub.io/webextension-polyfill/0.10.0/browser-polyfill.min.js';
document.head.appendChild(polyfill);

// Wait for the polyfill to load before running your code
polyfill.onload = () => {
  // Your code here, for example, using the 'browser.storage' API
  chrome.storage.sync.set({ key: 'value' }, () => {
    console.log('Value is set to i love webextensions');
  });
};
Copied!
Copied!
Copied!
Copied!

All versions