popup.js:
chrome.runtime.getBackgroundPage((bg) => {
bg.createTabObj();
Volume.init();
});
background.js:
createTabObj() {
chrome.tabCapture.capture({
audio: true,
video: false
},
(stream) => {
//do something
})
As it is, the popup continues to the next second line before the background method finished its process.
What's the simplest way to make sure that the background finishes processing the createTabObj
methods before the popup continues to Volume.init()
?
I prefer doing all the calls from the popup instead of a background callback, if possible.