我需要一些关于 Greasemonkey 脚本的帮助。我正在尝试替换 HTML 文档中的一些文本并从该网站删除一个 javascript 函数。
我要重写的表达式是 needCaptcha: true
into needCaptcha: false
。我也想删除这部分 HTML:
checkConfig = {
empty : "Enter the characters in the image",
error : "Type the characters you see"
},
我使用了这个脚本,但它不起作用:
{
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"'
},)
}
任何想法?
好的,非常感谢您的回答,我更了解我们正在尝试做的事情。但是您的脚本不起作用,在这里您可以找到它的网页,只要您可以访问下订单网页,这并不容易。
我认为验证码是在本地检查的,所以我们应该能够使用 javascript 绕过它。
无论如何,这里有网站的部分代码作为参考:
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>