New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reload content scripts after install/update #1041
Conversation
@@ -0,0 +1,15 @@ | |||
injectContentScriptsIntoOpenTabs = -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "installActions" mean? Can this just be folded into main.coffee? This should be named install_actions to match the other scripts.
This is a compelling developer workflow improvement if it works without too many side effects. Nice idea. |
@philc I think this is ready to go now, unless you have any concerns or queries. The only minor issue I've had is that the user Link Hint CSS from the settings page is given lower precedence than content script CSS after reloading the script, which is the inverse of usual. I've tried everything that immediately occurred to me to fix it and have had no success, so I think I'm just going to leave it. |
ead1c11
to
e769ae8
Compare
@philc I updated this PR in line with your comments. Do you have any more thoughts on this? |
@mrmr1993 Couldn't you sort the CSS array before loading them all? Last loaded CSS should have highest precedence |
@deiga the CSS arrays work perfectly, they load the scripts in exactly the same order as the brower loads them normally. The main issue is that |
The CSS issue is fixed now. |
261b2bc
to
c5f63f3
Compare
This loads the content scripts for pages when the extension is installed or updated (or reloaded in developer mode). This means that the new version of Vimium will become active immediately after loading, and so tabs won't have to be refreshed. As a devloper, this is amazing. Refreshing each tab individually after each code change was a pain.
This makes vimium respond on a tab even if 1) the hack for loading content scripts after an update is used on it and 2) the frame with focused on that tab is not the top frame.
This reverts commit 81ba689. chrome.tabs.executeScript provide a mechanism to avoid needing this.
c5f63f3
to
93511c1
Compare
In fact, if the frontend ports disconnect, there are two cases:
These commits deal with the second case well (applause). However, for the first case, we just need to re-connect those ports, which has been proved OKay by my customized version for months. A better way, isn't it? |
When a port disconnects, we can try By the way, what's |
This is @mrmr1993's work from philc#1041. Reload content scripts when vimium is installed or updates. (@mrmr1993: The automatic merge was really messy (or, at least, I couldn't figure out what was going on). Since the bulk of philc#1041 was actually quite compact, I took the liberty of just copying it in. Hope you don't mind.)
This is @mrmr1993's work from philc#1041. Reload content scripts when vimium is installed or updates. (@mrmr1993: The automatic merge was really messy (or, at least, I couldn't figure out what was going on). Since the bulk of philc#1041 was actually quite compact, I took the liberty of just copying it in. Hope you don't mind.)
This loads the content scripts for pages when the extension is
installed or updated (or reloaded in developer mode). This means that
the new version of Vimium will become active immediately after loading,
and so tabs won't have to be refreshed.
As a developer, this is amazing. Refreshing each tab individually after
each code change/extension reload was a pain.