-1

Bit of a noob here but I recently discovered Tampermonkey and it's amazing ability to use js userscripts on webpages. But since it's only found as a browser extension and I use multiple browsers, I was wondering whether there would be a sort of system-wide (Windows 10 btw) alternative to Tampermonkey that's able to work with all or most browsers, just for convenience's sake.

It'll certainly help with working with multiple userscripts instead of having to be on top of them for every single browser.

  • One option would be to continue to use Tampermonkey, but save your changes to somewhere internet-accessible (like github), and reference that URL with [@downloadURL or @updateURL](https://stackoverflow.com/questions/38023717/why-is-usage-of-the-downloadurl-updateurl-keys-called-unusual-and-how-do-they), not sure how reliable that is. Another option would be to fetch the canonical code *in the userscript itself*, then `eval` it (don't know if `GM__` functions would work though) – CertainPerformance Jan 30 '19 at 04:51
  • You'd willingly install a problem to your computer that has unrestricted access to all websites you visit on every one of your browsers? – Khauri Jan 30 '19 at 04:52
  • 1
    @KhauriMcClain You run the same sort of risk when installing *any* program. – CertainPerformance Jan 30 '19 at 04:53
  • Thanks @CertainPerformance, that linked answer was really helpful. I'll try out some things and see what I can accomplish. – CallMePedro Jan 30 '19 at 05:37

2 Answers2

2

There are two features of TamperMonkey which are useful for this. The first is the sync feature. You'll have to enable advanced settings mode to make it visiable. You can use several services to sync the scripts you have across devices, browsers, and profiles. I have used DropBox. This setup in TamperMonkey is a one-time setup for each installation of the extension (so if you have two profiles in your Chrome browser then you need to set it up in each one of them, but just the first time).

Then whenever you make any changes in any one of the TM installations, it will propagate to all the others. From what I've seen it usually takes about 15-30 minutes to Sync using DropBox. I assume TM has a pre-set interval to sync at around 15 minutes so if you just miss it, it will take 15 minutes to send the changes to DropBox and then another 15 for the other installation to pull the changes when it syncs up. But it does work. Only caveat I want to mention is that if you disable anything that doesn't sync. It syncs up new (added), removed (deleted), or changed scripts. But not active/inactive status.

The other feature is the ability to use local files. That can be enabled in Chrome itself and the setting can be set for each extension - in Chrome extensions click "Details" under TM and then enable "Allow access to File URLs". This will allow you to use @require in TM to reference a local or network location.

// @require file://C:\[directory]\[subdirectory]\TEST_FILE.user.js

You could then just maintain the local reference. But this method only works to sync up code if you have it referenced. It does not sync up new or removed scripts and does not change the code in any user scripts themselves. If you use the DropBox sync method it should do everything you need and you won't have to use this feature unless you want to.

turc1656
  • 105
  • 2
  • 6
0

The question is not completely clear, you might want a general tool like AutoIt.

However, Tampermonkey runs on all major browsers and offers a synchronization capability that supposedly syncs your scripts (¿and data?) across browsers (and machines).

Disclaimer: I have not used or tested this capability myself. YMMV.


It is not enough to just install the same scripts from a common source (as suggested in the comments above) as:

  1. If the script stores data, like with GM_setValue, then that data won't be the same across browsers.
  2. You have to remember to install the same script(s) everywhere.
  3. If it's not your script, you may have to copy and rehost it. And then keep track of when the original changes.
  4. Likewise, if you make changes to the script's local settings, or to Tampermonkey's general settings, then you need to remember to copy the changes everywhere.
Brock Adams
  • 90,639
  • 22
  • 233
  • 295