Remove userscript detection
This commit is contained in:
@@ -63,28 +63,19 @@ var UserscriptSettingTab = new Class({
|
|||||||
self.settings = App.getPage('Settings')
|
self.settings = App.getPage('Settings')
|
||||||
self.settings.addEvent('create', function(){
|
self.settings.addEvent('create', function(){
|
||||||
|
|
||||||
// See if userscript can be installed
|
|
||||||
var userscript = false;
|
|
||||||
try {
|
|
||||||
if(Components.interfaces.gmIGreasemonkeyService)
|
|
||||||
userscript = true
|
|
||||||
}
|
|
||||||
catch(e){
|
|
||||||
userscript = Browser.chrome === true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var host_url = window.location.protocol + '//' + window.location.host;
|
var host_url = window.location.protocol + '//' + window.location.host;
|
||||||
|
|
||||||
self.settings.createGroup({
|
self.settings.createGroup({
|
||||||
'name': 'userscript',
|
'name': 'userscript',
|
||||||
'label': 'Install the bookmarklet' + (userscript ? ' or userscript' : ''),
|
'label': 'Install the bookmarklet or userscript',
|
||||||
'description': 'Easily add movies via imdb.com, appletrailers and more'
|
'description': 'Easily add movies via imdb.com, appletrailers and more'
|
||||||
}).inject(self.settings.tabs.automation.content, 'top').adopt(
|
}).inject(self.settings.tabs.automation.content, 'top').adopt(
|
||||||
(userscript ? [new Element('a.userscript.button', {
|
new Element('a.userscript.button', {
|
||||||
'text': 'Install userscript',
|
'text': 'Install userscript',
|
||||||
'href': Api.createUrl('userscript.get')+randomString()+'/couchpotato.user.js',
|
'href': Api.createUrl('userscript.get')+randomString()+'/couchpotato.user.js',
|
||||||
'target': '_self'
|
'target': '_blank'
|
||||||
}), new Element('span.or[text=or]')] : null),
|
}),
|
||||||
|
new Element('span.or[text=or]'),
|
||||||
new Element('span.bookmarklet').adopt(
|
new Element('span.bookmarklet').adopt(
|
||||||
new Element('a.button.green', {
|
new Element('a.button.green', {
|
||||||
'text': '+CouchPotato',
|
'text': '+CouchPotato',
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
|
//
|
||||||
|
// If you can read this, you need to enable or install the Greasemonkey add-on for firefox
|
||||||
|
// If you are using Chrome, download this file and drag it to the extensions tab
|
||||||
|
// Other browsers, use the bookmarklet
|
||||||
|
//
|
||||||
// @name CouchPotato UserScript
|
// @name CouchPotato UserScript
|
||||||
// @description Add movies like a real CouchPotato
|
// @description Add movies like a real CouchPotato
|
||||||
// @grant none
|
// @grant none
|
||||||
|
|||||||
@@ -285,23 +285,15 @@ var CouchPotato = new Class({
|
|||||||
|
|
||||||
createUserscriptButtons: function(){
|
createUserscriptButtons: function(){
|
||||||
|
|
||||||
var userscript = false;
|
|
||||||
try {
|
|
||||||
if(Components.interfaces.gmIGreasemonkeyService)
|
|
||||||
userscript = true
|
|
||||||
}
|
|
||||||
catch(e){
|
|
||||||
userscript = Browser.chrome === true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var host_url = window.location.protocol + '//' + window.location.host;
|
var host_url = window.location.protocol + '//' + window.location.host;
|
||||||
|
|
||||||
return new Element('div.group_userscript').adopt(
|
return new Element('div.group_userscript').adopt(
|
||||||
(userscript ? [new Element('a.userscript.button', {
|
new Element('a.userscript.button', {
|
||||||
'text': 'Install userscript',
|
'text': 'Install userscript',
|
||||||
'href': Api.createUrl('userscript.get')+randomString()+'/couchpotato.user.js',
|
'href': Api.createUrl('userscript.get')+randomString()+'/couchpotato.user.js',
|
||||||
'target': '_self'
|
'target': '_blank'
|
||||||
}), new Element('span.or[text=or]')] : null),
|
}),
|
||||||
|
new Element('span.or[text=or]'),
|
||||||
new Element('span.bookmarklet').adopt(
|
new Element('span.bookmarklet').adopt(
|
||||||
new Element('a.button.orange', {
|
new Element('a.button.orange', {
|
||||||
'text': '+CouchPotato',
|
'text': '+CouchPotato',
|
||||||
|
|||||||
Reference in New Issue
Block a user