aboutsummaryrefslogtreecommitdiffstats
path: root/background_page.html
diff options
context:
space:
mode:
authorIlya Sukhar2010-10-24 19:43:57 -0700
committerIlya Sukhar2010-10-24 19:43:57 -0700
commit658981295b5c90b821b5eae1b3e2b6783db5e46d (patch)
treecd1625e6a6ee193af11aa95b44588c0738589e12 /background_page.html
parentc00dae33b8734d151437cdf4681423a01f89d674 (diff)
downloadvimium-658981295b5c90b821b5eae1b3e2b6783db5e46d.tar.bz2
Fix an excluded URLs regression due to frame support.
Diffstat (limited to 'background_page.html')
-rw-r--r--background_page.html11
1 files changed, 5 insertions, 6 deletions
diff --git a/background_page.html b/background_page.html
index 4d03c99b..f4a40ffa 100644
--- a/background_page.html
+++ b/background_page.html
@@ -59,7 +59,6 @@
var portHandlers = {
keyDown: handleKeyDown,
returnScrollPosition: handleReturnScrollPosition,
- isEnabledForUrl: isEnabledForUrl,
getCurrentTabUrl: getCurrentTabUrl,
getZoomLevel: getZoomLevel,
saveZoomLevel: saveZoomLevel,
@@ -75,7 +74,8 @@
frameFocused: handleFrameFocused,
upgradeNotificationClosed: upgradeNotificationClosed,
updateScrollPosition: handleUpdateScrollPosition,
- copyToClipboard: copyToClipboard
+ copyToClipboard: copyToClipboard,
+ isEnabledForUrl: isEnabledForUrl
};
// Event handlers
@@ -134,18 +134,17 @@
/*
* Checks the user's preferences in local storage to determine if Vimium is enabled for the given URL.
*/
- function isEnabledForUrl(args, port) {
- var returnPort = chrome.tabs.connect(port.tab.id, { name: "returnIsEnabledForUrl" });
+ function isEnabledForUrl(request) {
// excludedUrls are stored as a series of URL expressions separated by newlines.
var excludedUrls = (localStorage["excludedUrls"] || "").split("\n");
var isEnabled = true;
for (var i = 0; i < excludedUrls.length; i++) {
// The user can add "*" to the URL which means ".*"
var regexp = new RegExp("^" + excludedUrls[i].replace(/\*/g, ".*") + "$");
- if (args.url.match(regexp))
+ if (request.url.match(regexp))
isEnabled = false;
}
- returnPort.postMessage({ isEnabledForUrl: isEnabled });
+ return { isEnabledForUrl: isEnabled };
}
/*