From fb99302b22ddcc7a2ecd7c21e43f3548d937701d Mon Sep 17 00:00:00 2001 From: Jez Ng Date: Sun, 22 Jan 2012 08:35:23 -0500 Subject: Open URLs from the background page. Due to permissions issues, content scripts cannot use window.open() to navigate to file:// schemes from http:// schemes. Closes #456. --- bookmarks.js | 4 ++-- manifest.json | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bookmarks.js b/bookmarks.js index 67ef1cb3..d91d54db 100644 --- a/bookmarks.js +++ b/bookmarks.js @@ -70,9 +70,9 @@ function activateBookmarkFindMode() { var isABookmarklet = function(url) { return url.indexOf("javascript:") === 0; } if (!self.newTab || isABookmarklet(url)) - window.location = url; + chrome.extension.sendRequest({ handler: "openUrlInCurrentTab", url: url }); else - window.open(url); + chrome.extension.sendRequest({ handler: "openUrlInNewTab", url: url }); self.disable(); }, diff --git a/manifest.json b/manifest.json index 4b14f444..954d5e35 100644 --- a/manifest.json +++ b/manifest.json @@ -11,8 +11,7 @@ "tabs", "bookmarks", "clipboardRead", - "http://*/*", - "https://*/*" + "" ], "content_scripts": [ { -- cgit v1.2.3