【发布时间】:2016-11-30 03:02:29
【问题描述】:
以下脚本在 Firefox/Greasemonkey 中有效,但在 Chrome/Tampermonkey 中没有任何反应。
谁能明白为什么它在 Tampermonkey 中不起作用?
// ==UserScript==
// @name Example
// @namespace Example.com
// @description Example.com
// @include https://example.com/*
// @include http://example.com/*
// @version 1
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @require https://greasyfork.org/scripts/5392-waitforkeyelements/code/WaitForKeyElements.js?version=115012
// ==/UserScript==
window.onload = function(){
document.getElementById('close-cookies').click();
};
waitForKeyElements('div.survey16', removeSurvey);
function removeSurvey() {
document.getElementById('survey16').hide();
}
$('.chat-bot').hide();
【问题讨论】:
-
如果你放一些
console.log,它会登录到控制台吗?如果你删除一些@require
标签: javascript google-chrome greasemonkey tampermonkey