Coder Social home page Coder Social logo

peterhil / rosegarden Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 44 KB

Rosegarden gives you the promises for writing cross platform webextensions on Chrome and other browsers missing the promise based API.

License: Mozilla Public License 2.0

JavaScript 100.00%
cross-platform promise-api webextensions library chrome-extensions opera-extension edge-extensions

rosegarden's Introduction

Rosegarden

Rosegarden gives you the promises for writing cross platform web extensions on Chrome and other browsers missing the promise based API.

Archive note

This repository is archived, because the new promisified Chrome webextension manifest V3 APIs do not work well with this library.

Rationale

I know Mozilla provides webextension-polyfill, but I find even that too complicated.

With my Spellbook bookmark browser extension I promisified the required callback based methods from Chrome API and checked the chrome.runtime.lastError. Eventually I promisified the whole API, while planning on writing another cross platform browser extension.

I have used only bookmarks and tabs APIs, so beware when using other APIs, in case they differ between Firefox and Chrome.

Usage

import { browser } from 'rosegarden'

Then just use that browser object as you would use the Mozilla's promise based WebExtension API!

It just gives the global browser object on Firefox, but on Chrome it gives a promisified version of the chrome global object as browser. The browser object has chrome as prototype, so everything should work as expected as long as the APIs work in a similar way.

Library development

Install dependencies

pnpm install

Build unpackaged development version

pnpm run dev

Builds the library into the dev directory.

Build a minified production version

pnpm run build

Builds the library into the dist directory.

Licensing

Copyright © 2018–2022 Peter Hillerström and contributors

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

rosegarden's People

Contributors

peterhil avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

triptych

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.