Skip to content

Commit

Permalink
OK ALMOST
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Jun 5, 2019
1 parent c3e9356 commit f21bcee
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions source/libs/declarative-content-scripts.ts
@@ -1,5 +1,4 @@
/* global chrome */
import './content-scripts-register-polyfill';
import './permission-events-polyfill';

const registeredScripts = new Map<string, browser.contentScripts.RegisteredContentScript>();
Expand Down Expand Up @@ -27,22 +26,24 @@ async function registerOnOrigins(origins: string[]): Promise<void> {
let registeredScript;
try {

registeredScript = await browser.contentScripts.register({
const LOL = browser.contentScripts.register({
js: (config.js || []).map(convertPath),
css: (config.css || []).map(convertPath),
allFrames: config.all_frames,
matches: [origin],
runAt: config.run_at
});
console.log('lol is ', LOL)
window.WWWWWWWWWW = LOL;
LOL.then(y0 => console.log('NUTSSSS', y0), y0 => console.error('peanuts', y0))
} catch(error) {
console.log('error you', error);
}finally {
console.log('yoooooooooooooooooo');

}
console.log('done!!')

registeredScripts.set(origin, registeredScript);
// registeredScripts.set(origin, registeredScript);
console.log(origin, registeredScript)
}
}
Expand Down

2 comments on commit f21bcee

@notlmn
Copy link
Contributor

@notlmn notlmn commented on f21bcee Jun 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I know how @bfred-it debugs his code 😄

@fregante
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOLs and NUTS, when for some reason even setTimeout doesn't work

Please sign in to comment.