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.
chrome-extension-hot-reload
Advanced tools
hot reloads chrome extension on development, affects popup tabs and options page
This is an npm package that can be imported in background.js
and popup.js
files to make hot reloading possible in extensions.
Install it via npm install --save chrome-extension-hot-reload
In your background.js
script add the following in top
import HotReload from 'chrome-extension-hot-reload';
HotReload.start();
In your popup.js
script add the following in top
import HotReload from 'chrome-extension-hot-reload';
HotReload.connect();
connect
in options page or content scripts, they should already work automatically if you have called start
in background script.Alternatively, (if you don't want to import both the start & connect scripts in both background and popup files you can import them separately as in below)
import start from 'chrome-extension-hot-reload/dist/start';
start();
import connect from 'chrome-extension-hot-reload/dist/connect';
connect();
Alternatively, if you prefer ES5, you can import the module as in below (all of them should work)
const HotReload = require("chrome-extension-hot-reload");
const start = require("chrome-extension-hot-reload/dist/start");
const connect = require("chrome-extension-hot-reload/dist/connect");
In the connect
method you can pass an options
object to pass custom configurations.
import HotReload from 'chrome-extension-hot-reload';
HotReload.connect({
// the milliseconds for which the script re-checks for file changes
// by default, the script re-checks for every 1 second (1000 milliseconds)
retryTime: 1000,
// whether to output popup connect logs (debug logs), by default it is false
dbg: false
});
popup
/ options
page (doesn't force reloads the extension)background.js
is enough for hot reloading options pagestart/connect
syntax (even if you do not have a background script
, in order to get hot reloading in popups, you should create a background script
file in which you call start
)FAQs
hot reloads chrome extension on development, affects popup tabs and options page
The npm package chrome-extension-hot-reload receives a total of 32,926 weekly downloads. As such, chrome-extension-hot-reload popularity was classified as popular.
We found that chrome-extension-hot-reload 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.