Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
webextension-polyfill-ts
Advanced tools
This is a TypeScript ready "wrapper" for the WebExtension browser API Polyfill by Mozilla.
This guide assumes you are building a web-extension using npm and webpack, parcel or similar. If you are looking for an example use-case, check out the development branch of my web-extension Forget Me Not.
npm install --save-dev webextension-polyfill-ts
import { browser } from "webextension-polyfill-ts";
If you want to use the exported types in your code, simply import them like this:
import { Cookies } from "webextension-polyfill-ts";
function inspectCookie(cookie: Cookies.Cookie) {
//...
}
All types are inside their respective namespace:
browser.cookies
types are in the Cookies
namespacebrowser.devtools.inspectedWindow
types are in the DevtoolsInspectedWindow
namespace.Consider mockzilla-webextension for unit-testing. It combines all the types this package provides with some nifty mocking functionality.
There are still some issues left:
See CONTRIBUTING.md
If you have problems, questions or other feedback, please create an issue here on Github.
My generator code of this project has been released under the zlib/libpng License
The schema files from mozilla however have defined their own licences, which will be exported to the generated .ts files as well. For example, there are files under the Mozilla Public License and some under a BSD style license.
FAQs
webextension-polyfill for TypeScript
The npm package webextension-polyfill-ts receives a total of 43,439 weekly downloads. As such, webextension-polyfill-ts popularity was classified as popular.
We found that webextension-polyfill-ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.