Okay, a little context. I want to modify some crappy HTML on a page that I use a lot. I'm doing this via my content_script "js", as defined in the manifest.json file of the chrome extension. The primary method I've been using is this sort of ugly thing:
var str1 = 'something already on the page'; var str2 = 'something already on the page, plus some extra stuff'; document.body.innerHTML = document.body.innerHTML.replace(str,st2); I'm mostly trying to re-order form objects, and expand them a little to show more information, and filter/condense them to be less superfluous. I'd appreciate any pointer as to a better way to do this.
Anyway... here's my specific problem.
I want to retrieve pistol (or any string) from the following:
<form action="map.cgi?use-o" method="post" class="a"><input type="submit" value="pistol" class="m"\></form> I tried every variation of the following:
str.exec(/value="([^]+)" class/); and I'm either getting null or junk strings that I don't want. Ideas?
Thanks!