Skip to content

Commit

Permalink
Workaround for devpanel not having access in incognito mode
Browse files Browse the repository at this point in the history
Related to #597 and 580
  • Loading branch information
zalmoxisus committed Nov 28, 2018
1 parent de2c792 commit d11eb65
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/browser/extension/devtools/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
chrome.devtools.panels.create(
'Redux', 'img/logo/scalable.png', chrome.extension.getBackgroundPage ? 'window.html' : 'devpanel.html', function() {}
);
function createPanel(url) {
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');
}

0 comments on commit d11eb65

Please sign in to comment.