tampermonkey url导入和更新无法正常工作 - chrome

时间:2017-01-19 11:53:15

标签: javascript google-chrome userscripts tampermonkey

我有一个简单的用户脚本,用于在谷歌浏览器中使用tampermonkey重新设置弹出窗口。在tampermonkey扩展中一切正常但是我需要在多个用户浏览器中安装和维护脚本,因此我试图在我们的服务器上托管文件并通过url导入导入和更新并在tampermonkey中更新(如果可能的话)? / p>

当我尝试通过url导入时,我得到'invalid userscrip sry'弹出窗口,当我尝试更新服务器上的脚本时,即使我得到一个“操作成功”弹出窗口,也没有更新。

我是使用tampermonkey和userscripts的新手,我似乎无法找到我出错的地方?

这是我的代码:

// ==UserScript==
// @name         zendesk-popup-style-changes
// @version      0.1
// @description  Zendesk popup style changes for Essential E-Commerce LTD
// @author       Aaron Sly
// @match        https://essential-commerce.zendesk.com/*
// @grant        none
// @downloadURL  https://www.theheatingboutique.co.uk/zendesk-popup-style-changes.user.js
// ==/UserScript==

(function() {
'use strict';

function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}

addGlobalStyle('div.jGrowl div.jGrowl-notification{ width: 400px; font-size:15px;background-color: #D6FFDF; animation: pulse 2s linear infinite, nudge 2s linear infinite;  }');
addGlobalStyle('div.jGrowl div.jGrowl-notification.ui-state-alert a {border-bottom: 2px solid #FFA914;} ');
addGlobalStyle('div.jGrowl div.jGrowl-notification .jGrowl-close {opacity:1;}');
addGlobalStyle('@keyframes pulse { 0%, 100% { background-color: #FFC6C2; } 50% { background-color: #FFECEB; } }');
addGlobalStyle('@keyframes nudge { 0%, 50%, 60%, 100% { transform: translate(0, 0); } 25% { transform: translate(-1%, 0); } 55% {transform: translate(0.5%,0) } } ');

})();

0 个答案:

没有答案