Skip to content

Commit

Permalink
revert : keeping the old approach for Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
kabir-afk committed Jun 19, 2024
1 parent 842dc59 commit f6b6e71
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions popup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,21 @@ var browser = (browserType === 'firefox') ? browser : (browserType === 'chrome')
ui = new UI();
ui.switchPanel( 'loaded' );
}
chrome.runtime.onMessage.addListener((message, sender) => {
console.log(sender);
if (message.state === "ready") {
if (browserType === "chrome") {
chrome.runtime.onMessage.addListener((message, sender) => {
if (message.state === "ready") {
ui = new UI();
}
});
} else {
let state = _backgroundPage.state;
function waitWhileLoading() {
if (state === "ready") {
ui = new UI();
} else {
setTimeout(waitWhileLoading, 100);
}
});
}
waitWhileLoading();
}
})();

0 comments on commit f6b6e71

Please sign in to comment.