From 3876a4f06de77d190fdaecc6cf99eb57134d0372 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 15 Mar 2015 12:32:42 +0000 Subject: Populate popup with frame's URL. Previously, we have been populating the suggested exclusion URL in the page popup with the tab's URL. This uses the active frame's URL instead: - because this is the URL which will affect the current frame (without this, a user can naively add an exclusion rule and it has no effect), and - because, without this, the user has no reasonable way to add exclusion rules for frames such as the hangouts frame on gmail (for which, the URL is not displayed in the address bar). --- content_scripts/vimium_frontend.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 429657fc..757cc0ad 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -190,6 +190,7 @@ initializePreDomReady = -> # Ensure the sendResponse callback is freed. false + # Wrapper to install event listeners. Syntactic sugar. installListener = (element, event, callback) -> element.addEventListener(event, -> @@ -227,12 +228,12 @@ getActiveState = -> return { enabled: isEnabledForUrl, passKeys: passKeys } # -# The backend needs to know which frame has focus. +# The backend needs to know which frame has focus, and the active URL. # registerFocus = -> # settings may have changed since the frame last had focus settings.load() - chrome.runtime.sendMessage({ handler: "frameFocused", frameId: frameId }) + chrome.runtime.sendMessage handler: "frameFocused", frameId: frameId, url: window.location.toString() # # Initialization tasks that must wait for the document to be ready. -- cgit v1.2.3