10

I'm browsing a website a few time a day, and one button is disabled, I have to manually enable it from developer menu / Element

<div class="actioning-buttons">
  <button class="action-button one-action-button" disabled="">Number 1</button> 
</div>

Can I automatically have this enabled for this database / website without having to do a manual edit all the time?

PS Im using Google Chrome for OSX

Sagar V
  • 12,158
  • 7
  • 41
  • 68
Kevin
  • 1,076
  • 4
  • 22
  • 49
  • A userscript is the way to go: https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en – thirtydot Jun 13 '17 at 10:38

2 Answers2

8

You can create a simple bookmarklet to achieve this. When you trigger the bookmark, your browser will run the code in the context of the current page. I know this isn't really automating the process but since you don't have a fixed URL for the page, this will probably have to do. It's definitely an improvement over opening your developer tools each time and manually editing the code.

Here's a bookmarklet that, when run, will look for all buttons with the classes action-button and one-action-button, then remove the disabled attribute.

javascript:Array.from(document.getElementsByClassName('action-button one-action-button')).forEach(function(v){v.removeAttribute("disabled");});

Just add a new bookmark, type the above code as is in the URL/location field and save it some place handy. Click on it each time you want to remove the disabled attribute.

Let me know if you need anything else!

Daksh
  • 956
  • 6
  • 19
4

That is the Job of a userscript manager.

A userscript manager does the task of injecting scripts defined by user to sites they visit automatically.

For Firefox, Greasemonkey is there and for Chrome, Tampermonkey is there

After you install the extension, do the steps

  • Go to the site where you want it to work

  • click on the icon and choose Create new script enter image description here

  • It will give a page like this

enter image description here

  • Enter the script and save it.
Sagar V
  • 12,158
  • 7
  • 41
  • 68
  • Ah shoot! You beat me to it! Worthy post to look at: https://stackoverflow.com/questions/6686070/changing-html-with-greasemonkey – LoKat Jun 13 '17 at 10:53
  • Thank for the reply, unfortunately Tampermonkey redirect me to the Google Chrome download page, I guess it's not compatible with OSX. I'll try to found a another userscript Manager – Kevin Jun 13 '17 at 10:54
  • @KevinCork looks weird. https://productforums.google.com/forum/#!topic/chrome/X0rBvBWoVjc – Sagar V Jun 13 '17 at 11:01
  • PS the URL address of the page I want to change have a dynamic encrypted text (which mean that the full URL is never the same) – Kevin Jun 13 '17 at 11:30
  • then it will be difficult. Do you have any problem in disclosing the url? If not, please give me the url – Sagar V Jun 13 '17 at 11:31