From 7ec3bc449dda34007c75d580b9a75f95c40bb4f3 Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Tue, 31 May 2016 15:09:27 +0200 Subject: Remove old Firefox specific hacks --- js/popup.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'js/popup.js') diff --git a/js/popup.js b/js/popup.js index 1241d20..0467286 100644 --- a/js/popup.js +++ b/js/popup.js @@ -20,8 +20,10 @@ angular.module('popupApp', []).controller('PopupCtrl', ['$scope', function($s) { //switch to open one if we have it to minimize conflicts var url = chrome.extension.getURL('redirector.html'); - - chrome.tabs.query({currentWindow:true}, function(tabs)) { + + //FIREFOXBUG: Firefox chokes on url:url filter if the url is a moz-extension:// url + //so we don't use that, do it the more manual way instead. + chrome.tabs.query({currentWindow:true}, function(tabs) { for (var i=0; i < tabs.length; i++) { if (tabs[i].url == url) { chrome.tabs.update(tabs[i].id, {active:true}, function(tab) { @@ -34,14 +36,5 @@ angular.module('popupApp', []).controller('PopupCtrl', ['$scope', function($s) { chrome.tabs.create({url:url, active:true}); }); return; - chrome.tabs.query({currentWindow:true, url:url}, function(tabs) { - if (tabs.length > 0) { - chrome.tabs.update(tabs[0].id, {active:true}, function(tab) { - close(); - }); - } else { - chrome.tabs.create({url:url, active:true}); - } - }); }; }]); \ No newline at end of file -- cgit v1.2.3