Closed smblott-github closed 9 years ago
It seems that this part should be:
allFrames: content_scripts.all_frames
Here is an example of chrome.runtime.getManifest().content_scripts[0]
:
{
"all_frames": true,
"css": [
"content_scripts/vimium.css"
],
"js": [
"lib/keyboard_utils.js",
"lib/dom_utils.js",
"content_scripts/vimium_frontend.js"
],
"matches": [
"<all_urls>"
],
"run_at": "document_start"
}
Excellent. Thanks for that, @gdh1995. See https://github.com/philc/vimium/commit/9fdb630d891019620041041001b9dff022008ee0.
Firstly, main.coffee
usually runs much faster than so many content_scripts/*.coffee
.
So, if we keep it at the top, nothing will go into an error - moving it to the bottom also does not do any harm, though.
@gdh1995 the actual injection code is inside an asynchronous callback, so it shouldn't slow down the normal initialisation of main.coffee
at all. Or am I missing something?
Sorry I forgot this. Yes, it is indeed executed in 0 ms or 16ms in my tests. So nothing should be changed.
Notwithstand this:
when Vimum restarts and we reinject the content scripts, only the main/top frame seems to restart. Try it here.
(Separately, I wonder whether we wouldn't be better moving the reinjection code to the bottom of
main.coffee
, after everything else is initialised.)