diff --git a/couchpotato/core/plugins/userscript/static/userscript.js b/couchpotato/core/plugins/userscript/static/userscript.js index 01451aa..63f5fc9 100644 --- a/couchpotato/core/plugins/userscript/static/userscript.js +++ b/couchpotato/core/plugins/userscript/static/userscript.js @@ -86,7 +86,7 @@ var UserscriptSettingTab = new Class({ new Element('a', { 'text': 'Install userscript', 'href': Api.createUrl('userscript.get')+'couchpotato.user.js', - 'normalhref': true + 'target': '_self' }) ); diff --git a/couchpotato/static/scripts/couchpotato.js b/couchpotato/static/scripts/couchpotato.js index 76c5a60..fd34a24 100644 --- a/couchpotato/static/scripts/couchpotato.js +++ b/couchpotato/static/scripts/couchpotato.js @@ -28,7 +28,7 @@ var CouchPotato = new Class({ self.openPage(window.location.pathname); History.addEvent('change', self.openPage.bind(self)); - self.c.addEvent('click:relay(a[href]:not([target=_blank]):not([normalhref=true]))', self.pushState.bind(self)); + self.c.addEvent('click:relay(a[href^=/]:not([target]))', self.pushState.bind(self)); }, getOption: function(name){ @@ -42,11 +42,12 @@ var CouchPotato = new Class({ pushState: function(e){ var self = this; - (e).stop(); - - var url = e.target.get('href'); - if(History.getPath() != url) - History.push(url); + if((!e.meta && Browser.Platform.mac) || (!e.control && !Browser.Platform.mac)){ + (e).stop(); + var url = e.target.get('href'); + if(History.getPath() != url) + History.push(url); + } }, createLayout: function(){