1
我已經爲StumbleUpon做了一個Greasemonkey腳本,它工作。但突然之間,也許經過Mozilla或Scriptish更新後,它停止了所有協議的工作。我的Greasemonkey腳本在更新內容後停止工作
請檢查my script是否有錯誤。我在腳本新手
腳本:
// ==UserScript==
// @name [udit]add stumblethru image-flip button[w/o container] on all websites
// @namespace testing-for-that-script
// @description
// @include http://facebook.com/*
// @include http://*
// @include https://*
// @include *
// @exclude file:///*
// ==/UserScript==
if (window.top != window.self) //don't run on frames or iframes
{
//Optional: GM_log ('In frame');
return;
}
/*--- Create a button in a container div. It will be styled and positioned with CSS.
*/
var zNode = document.createElement ('input');
zNode.setAttribute ('id', 'suButton');
zNode.setAttribute('type', 'image');
zNode.setAttribute('src', 'http://www.creativeadornments.com/nephco/doraemon/icons/doraemon_18a.gif');
document.body.appendChild (zNode);
function tiddu1()
{
document.getElementById("suButton").src ="http://www.creativeadornments.com/nephco/doraemon/icons/doraemon_07.gif";
}
function tiddu2()
{
document.getElementById("suButton").src ="http://www.creativeadornments.com/nephco/doraemon/icons/doraemon_18a.gif";
}
function tiddu3()
{
document.getElementById("suButton").src ="http://www.creativeadornments.com/nephco/doraemon/icons/dorami_01a.gif";
}
function tiddu4()
{
document.getElementById("suButton").src ="http://t1.gstatic.com/images?q=tbn:ANd9GcSI_hx0nLvnO-Em6elAxyMnoBFGw8IMD3Yrpep4XY2I51GylSRf3jHiabAyiw";
}
//--- Activate the newly added button and add rollover image handling.
var zNode = document.getElementById ("suButton");
zNode.addEventListener ("click", ButtonClickAction, true);
zNode.addEventListener ("mouseover", tiddu1, true);
zNode.addEventListener ("mouseout", tiddu2, true);
zNode.addEventListener ("mousedown", tiddu3, true);
zNode.addEventListener ("click", tiddu4, true);
function ButtonClickAction (zEvent)
{
//--- For our dummy action, we'll just add a line of text to the top of the screen.
var button = document.createElement ('a');
location.href='http://www.stumbleupon.com/to/stumble/stumblethru:'+location.href.replace("http://","").replace("https://","").replace("ftp://","").split('/',4)[0];
}
//--- Style our newly added elements using CSS.
GM_addStyle ((<><![CDATA[
#suButton {
position: fixed;
bottom: 0px;
left: 0px;
margin: 0px 0px 50px 0px;
opacity: 0.8;
cursor: url(C:\buttercup_06.cur),url(http://www.creativeadornments.com/nephco/powerpuffgirls/cursors/ppg_01anim.gif),url(myBall.cur),pointer;
border: 0px outset red;
z-index: 222;
padding: 5px 5px;
}
]]></>).toString());
這是最有幫助和工作的朋友!一個偉大的放鬆。在同一種腳本中存在一點點問題,我嘗試根據解決方案對其進行修改,但它不起作用。這一點腳本是下一個評論,請審查。我的英語不好的技能或網站ettiquete,你必須編輯我的問題。 – adi
我無法在評論中放置一些腳本,所以我更新/編輯了該問題以插入該腳本。 – adi
爲了避免混淆,爲了避免混淆,只要問題的答案適用於所問的問題,但是您的原始問題中未包含新的皺紋,但答案無效,請在評論中提問(如果它足夠小)或打開一個新的問題並鏈接回原來的。在這種情況下,鏈接到一個pastebin(來自你的評論)就足夠了,但編輯這個問題有點令人困惑。所有這一切...... –