gpt4 book ai didi

javascript - 如何使用 Greasemonkey 更改此 javascript?

转载 作者:行者123 更新时间:2023-12-02 19:33:39 28 4
gpt4 key购买 nike

这是脚本:

<script type="text/javascript">
// <![CDATA[
$(document).ready(function() {
$('#file_upload').uploadify({
'uploader' : '/uploadify/uploadify.swf',
'script' : '/upload2.php',
'cancelImg' : '/uploadify/cancel.png',
'folder' : '/uploads',
'auto' : false,

'onError' : function (event,ID,fileObj,errorObj) {
alert(errorObj.type + ' Error: ' + errorObj.info);
},
'fileExt' : '*.wma;*.mp3',
'fileDesc' : 'Audio Files',
'scriptData' : {'fileID':'20541','hash':'2e1177c09a6503d11b1a401177022de50409e96279a2dbb11c5aef5783d231c975da22e2ddfd480b5e050f4fb09d9b7caa47a71ab0150b7c462b06d06e61e664','hashit':'fe458d423c6d1c18248b73dad776a9d4a6ff1ac9fc4b07674b3715b4992a80b9d2b4e3a340973642497d66ac8e8d57d7aa737f8911a784888b164e84961f177a'},
'onComplete' : function(eventID,ID,fileObj,response,data) {
window.location = "http://www.messageshare.com/welcome/file_farm/20541/fe458d423c6d1c18248b73dad776a9d4a6ff1ac9fc4b07674b3715b4992a80b9d2b4e3a340973642497d66ac8e8d57d7aa737f8911a784888b164e84961f177a";
}
});
});
// ]]>
</script>

我需要将 'auto'false 更改为 true

最佳答案

自从所有这些scriptData值似乎很容易在页面加载之间发生变化,您想要做的是拦截 <script>动态节点,克隆它并仅更改 'auto'true ,使用正则表达式。

在 Firefox Greasemonkey 上,您可以使用 the stupefyingly brilliant (^_^) checkForBadJavascripts utility 来做到这一点。就像这样:

// ==UserScript==
// @name _Modify JS as it's loaded
// @include http://YOUR_SERVER.COM/YOUR_PATH/*
// @require https://gist.github.com/raw/2620135/checkForBadJavascripts.js
// @run-at document-start
// @grant GM_addStyle
// ==/UserScript==
/*- The @grant directive is needed to work around a design change
introduced in GM 1.0. It restores the sandbox.
*/

function replaceTargetJavascript (scriptNode) {
var scriptSrc = scriptNode.textContent;
scriptSrc = scriptSrc.replace (
/'auto'\s+\:\s+false/,
"'auto' : true"
);

addJS_Node (scriptSrc);
}

checkForBadJavascripts ( [
[false, /'auto'\s+\:\s+false/, replaceTargetJavascript]
] );

关于javascript - 如何使用 Greasemonkey 更改此 javascript?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11200509/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com