So I've been messing around with Javascript lately.
I wrote this to mess with some page code:
javascript:
var divs = document.getElementsByClassName("corrupted-repair-button");
for (var x = 0; x < divs.length; x++) {
var elem=divs[x];
elem.removeAttribute('hidden')
}
What I'm trying to do is remove a "hidden" attribute from an element with that class name.
Thing is, it works in the Inspect console,but when I stick it in a bookmark or the onmibar it never works and I have no idea why.
Pretty new to JS so it's probably staring me straight in the face and I haven't caught it yet.
But does it work when you paste it in the addres bar? Watcvh out though, Chrome removes the javascript: part when you paste it sop you have to type it manually. Im not sure it it does that with bookmarks too.
I don't think bookmarks are supposed to contain multiple lines. Have you tried writing it all on one line like this?
javascript:var divs=document.getElementsByClassName("corrupted-repair-button");for (var x=0;x<divs.length;x++) {divs[x].removeAttribute('hidden');}
I have tried all of the above to no luck. Bookmarks automatically put everything on the same line, so no problems there; I know they work b/c the image replacer script (BATMAN) works as a bookmark.
Maybe it has something to do with the console needing to be in this mode and not the default "top" mode?
(https://i.imgsafe.org/7bbd99cef6.png)
in your first post... I think you forgot the ; after the elem.removeAttribute('hidden')
*Will try something out, now ^^
ok this code worked for me:
var divs = document.getElementsByClassName("corrupted-repair-button");
for (var x = 0; x < divs.length; x++) {
divs[x].style.hidden='';
}
If you have jQuery you can do it a lot eaier by just calling
$('.corrupted-repair-button').style.hidden='';
At least I think so... ^^