redux-devtools/extension/src/devtools/index.ts
Nathan Bierema 4e0620c131
Build extension with esbuild (#1476)
* window.bundle.js seems to work

* minify

* Use API instead of CLI

* Add remote bundle

* Perform code-splitting

* Add background and stop code-splitting

* Add other entrypoints

* Flesh out some more

* Keep going

* Copy to browser directories

* Ignore import type error

* Strip out webpack stuff

* Remove todos

* Remove pug imports

* Fix
2023-08-30 20:59:38 -04:00

18 lines
429 B
TypeScript

function createPanel(url: string) {
chrome.devtools.panels.create(
'Redux',
'img/logo/scalable.png',
url,
function () {},
);
}
if (chrome.runtime.getBackgroundPage) {
// Check if the background page's object is accessible (not in incognito)
chrome.runtime.getBackgroundPage((background) => {
createPanel(background ? 'window.html' : 'devpanel.html');
});
} else {
createPanel('devpanel.html');
}