Chrome extension simulator is a debugging environment web app for developing popup Chrome extensions outside of Chrome, albeit not even close to feature-complete.
-
Add
chrome-simulator.js
directly into your project. -
Take your top-level code and instead call it using
ChromeExtensionSimulator.run
. For example,// before chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { const url = tabs[0].url; console.log(url); }
// after ChromeExtensionSimulator.run(() => { chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { const url = tabs[0].url; console.log(url); } });
This will not affect how your code runs; it merely allows the simulator to work.
-
Place
index.html
in the same directory or in an enclosing directory. -
Host
index.html
locally by runningmake
(this is the Makefile).
That's it!