Can I just get my user script to load when only doing CTRL+S and F5?

1

Currently I have to open it in Google Chrome from Notepad++ (CTRL+ALT+SHIFT+R) and click two buttons in Google Chrome and reload the page each time I want to get my user script loaded again in Google Chrome, how do I make this as simple as:

  1. Save the user script in Notepad++.

  2. Refresh the page in Google Chrome.

This would make testing different small changes during development much easier.

Tamara Wijsman

Posted 2012-06-09T20:27:50.823

Reputation: 54 163

Does ctrl+shift+r work? – VenkatH – 2012-06-09T20:34:38.483

@VenkatH: I don't see how a cache refresh would help here. – Tamara Wijsman – 2012-06-09T20:37:36.050

Answers

1

See the "Controlling the Script and name" part of this SO answer. Once you setup your userscript as directed there, then you merely save your changed script file and hit one "Reload" link to update it in Chrome. It's much nicer than the drag and triple-click method, although you'll want to keep the extensions tab open for lots of rapid changes.

Alas, Chrome may never make it easier than that. I can't find it right now, but pretty sure I once saw a discussion where they didn't want to check extension/content-script source for updates on every page load. It would needlessly slow Chrome 99% of the time.

Brock Adams

Posted 2012-06-09T20:27:50.823

Reputation: 2 000

I don't want to surf to the extensions, scroll till I finally find the extension somewhere and then click the reload, that's even harder than the Notepad --> Google Chrome sequence. – Tamara Wijsman – 2012-06-09T21:31:16.983

Then you could compile your own version of Chrome that checked extension files for updates at every (non cached) page load. ;) Sorry, that's the best Chrome allows for now. And no, my method is not hard at all in practice... Ctrl-S, Alt-tab(s), click, F5. Bada-bing, less than 1 second total, and only one click needed (even that can be done via the keyboard). – Brock Adams – 2012-06-09T21:33:44.960

So, doing a cache refresh would reload the unpacked extension? – Tamara Wijsman – 2012-06-09T21:34:37.773

Only, in your *custom Chrome build*! That was a hypothetical scenario were you compiled your own Chrome browser. – Brock Adams – 2012-06-09T21:37:56.450

Okay, then this is the fastest Chrome way to do it if I keep the Extensions tab open. Slowing down Chrome by 99% is a lie because you can monitor file changes without any cost by subscribing to I/O events. I might end up writing a script that will automatically click the two buttons in Chrome in the end... – Tamara Wijsman – 2012-06-09T21:41:37.923

That was slow down 99% of the time, not by 99%. Anyway, that's just what I remember from the discussion (which I still can't find), not a direct quote. – Brock Adams – 2012-06-09T21:48:21.643

On Windows at least, you can monitor a directory / file in the way the visitor pattern works. That way, it will only take CPU / I/O when an actual change happens; it won't keep probing the file on each reload. Doing it this way, there is 0% slowdown when the file isn't changed and only slow down when the file has been changed (to reload it). Example. In any case, it is possible but it just isn't there yet...

– Tamara Wijsman – 2012-06-09T21:57:35.843