From b3e4caa59f3fb7d3d277a8692d3012a7072f0b36 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 30 Sep 2017 08:07:10 -0400 Subject: [PATCH] code review of #3073 --- platform/chromium/vapi-background.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/chromium/vapi-background.js b/platform/chromium/vapi-background.js index 875a05195..46a3870ac 100644 --- a/platform/chromium/vapi-background.js +++ b/platform/chromium/vapi-background.js @@ -351,10 +351,11 @@ vAPI.tabs.registerListeners = function() { // https://github.com/gorhill/uBlock/issues/3073 // - Fall back to `tab.url` when `changeInfo.url` is not set. var onUpdated = function(tabId, changeInfo, tab) { + if ( typeof changeInfo.url !== 'string' ) { + changeInfo.url = tab && tab.url; + } if ( changeInfo.url ) { changeInfo.url = sanitizeURL(changeInfo.url); - } else { - changeInfo.url = tab && tab.url; } onUpdatedClient(tabId.toString(), changeInfo, tab); };