I need some help with a Greasemonkey script. I'm trying to replace some text in an HTML document and to delete a javascript function from that website.
The expression I want to rewrite is needCaptcha: true into needCaptcha: false . I want to remove this portion of HTML too:
checkConfig = {
empty : "Enter the characters in the image",
error : "Type the characters you see"
},
I used this script but it doesn't work:
{
document.body.innerHTML = document.body.innerHTML.replace('needCaptcha: true ', 'needCaptcha: false');
document.body.innerHTML = document.body.innerHTML.replace('checkConfig = {
empty : "Enter the characters in the image"/,
error : "Type the characters you see"'
},)
}
Any idea?
Ok, thank you very much for your answer I understand it better what we are trying to do. However your script didn't worked, here you have the webpage where you can find it, as long as you can get to the place order webpage and that isn't easy.
I think the captcha is checked in local and so we should be able to bypass that using javascript.
Anyway, here you have the partial code of the website as a reference:
script type="text/javascript">
var placeOrderConfig = {
rate : "0.95",
userType : "cnfm",
editAddressUrl : "mailing_address.htm",
editAddressUrlNoMember : "mailing_address_no_member.htm" ,
changeAddressUrl : "change_mailing_address.htm",
quickZoneUrl : "quickLoginRegister.htm?loginReturn=",
editAddressWinTitle : "Edit Shipping Address",
changeAddressWinTitle : "Change Shipping Address",
addAddressWinTitle : "Add New Shipping Address",
defaultMessage : "Please enter your message to the supplier here",
remoteCheckEmailUrl : "$usMyalibabaServer/user/join/CheckEmail.htm",
noMemberAction : "noMemberResult.htm" ,
needCheckCode: true },
productData = [[602092306,"wholesaleProduct","promotion_gaga","US","",1,"CPAM","14%3A173%23blue%3B5%3A100014064",200282334]],
quantityConfig = {
minErrorText : 'Please enter a Min. Order quantity that is <span id="min"></span> or more.',
maxErrorText : 'Please enter a number that is <span id="max"></span> or less.'
},
checkConfig = {
emptyErorText : "Enter the characters you see in the image",
errorText : "Type the characters you see in the picture"
},
backHistoryUrl = "";
</script>
needCaptcha: trueforneedCaptcha: falsein the html document and delete:checkConfig = { empty : "Enter the characters in the image", error : "Type the characters you see"And unfortunately I don't access right now to the website.