Monday, May 20, 2024
112
rated 0 times [  117] [ 5]  / answers: 1 / hits: 43838  / 13 Years ago, wed, august 24, 2011, 12:00:00

I would like to be able to add custom snippets of javascript to any site that matches a regex. This is mostly because of sites that I use daily because of specialized content, but which have a poor design. I want to be able to do something like:




  • Visit site See that sidebar overwrites content

  • Whip out developer tools, find div id for sidebar

  • Edit a snippet of javascript which is executed on document.ready for this domain:



    $('#sidebar-right').remove();



A bit of searching for user scripts tells me that I need to be writing a Chrome extension, which seems unfortunate and overkill. Is there not an easier way, or an extension which is nothing but a javascript editor that assigns snippets to domains? I'd really like to be able to edit in Chrome itself, or at least have a file that I can just leave open in MacVim all the time. An extension requires unloading/installing to update as far as I can tell.



If I just had one big javascript file, that would be fine. I'd just wrap my customizations in domain checks.



Bonus love if I can write in CoffeeScript.


More From » google-chrome

 Answers
8

The answer is to use the Tampermonkey chrome extension.


https://chrome.google.com/webstore/detail/dhdgffkkebhmkfjojejmpbldmpobfkfo


[#90451] Tuesday, August 23, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
minab

Total Points: 701
Total Questions: 104
Total Answers: 91

Location: Saint Pierre and Miquelon
Member since Fri, Jan 28, 2022
2 Years ago
;