Update Userscript with @grant
This commit is contained in:
@@ -15,7 +15,7 @@ log = CPLog(__name__)
|
|||||||
|
|
||||||
class Userscript(Plugin):
|
class Userscript(Plugin):
|
||||||
|
|
||||||
version = 2
|
version = 3
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
addApiView('userscript.get/<random>/<path:filename>', self.getUserScript, static = True)
|
addApiView('userscript.get/<random>/<path:filename>', self.getUserScript, static = True)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name CouchPotato UserScript
|
// @name CouchPotato UserScript
|
||||||
// @description Add movies like a real CouchPotato
|
// @description Add movies like a real CouchPotato
|
||||||
|
// @grant none
|
||||||
// @version {{version}}
|
// @version {{version}}
|
||||||
|
|
||||||
// @match {{host}}*
|
// @match {{host}}*
|
||||||
@@ -44,21 +45,19 @@ function create() {
|
|||||||
return A;
|
return A;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof GM_addStyle == 'undefined'){
|
var addStyle = function(css) {
|
||||||
GM_addStyle = function(css) {
|
var head = document.getElementsByTagName('head')[0],
|
||||||
var head = document.getElementsByTagName('head')[0],
|
style = document.createElement('style');
|
||||||
style = document.createElement('style');
|
if (!head)
|
||||||
if (!head)
|
return;
|
||||||
return;
|
|
||||||
|
|
||||||
style.type = 'text/css';
|
style.type = 'text/css';
|
||||||
style.textContent = css;
|
style.textContent = css;
|
||||||
head.appendChild(style);
|
head.appendChild(style);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Styles
|
// Styles
|
||||||
GM_addStyle('\
|
addStyle('\
|
||||||
#cp_popup { font-family: "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif; -moz-border-radius: 6px 0px 0px 6px; -webkit-border-radius: 6px 0px 0px 6px; border-radius: 6px 0px 0px 6px; -moz-box-shadow: 0 0 20px rgba(0,0,0,0.5); -webkit-box-shadow: 0 0 20px rgba(0,0,0,0.5); box-shadow: 0 0 20px rgba(0,0,0,0.5); position:fixed; z-index:9999; bottom:0; right:0; font-size:15px; margin: 20px 0; display: block; background:#4E5969; } \
|
#cp_popup { font-family: "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif; -moz-border-radius: 6px 0px 0px 6px; -webkit-border-radius: 6px 0px 0px 6px; border-radius: 6px 0px 0px 6px; -moz-box-shadow: 0 0 20px rgba(0,0,0,0.5); -webkit-box-shadow: 0 0 20px rgba(0,0,0,0.5); box-shadow: 0 0 20px rgba(0,0,0,0.5); position:fixed; z-index:9999; bottom:0; right:0; font-size:15px; margin: 20px 0; display: block; background:#4E5969; } \
|
||||||
#cp_popup.opened { width: 492px; } \
|
#cp_popup.opened { width: 492px; } \
|
||||||
#cp_popup a#add_to { cursor:pointer; text-align:center; text-decoration:none; color: #000; display:block; padding:5px 0 5px 5px; } \
|
#cp_popup a#add_to { cursor:pointer; text-align:center; text-decoration:none; color: #000; display:block; padding:5px 0 5px 5px; } \
|
||||||
|
|||||||
Reference in New Issue
Block a user