Fixes #721; popover works in tabs without explicit URL

This commit is contained in:
Chris 2015-02-09 19:31:21 -07:00
parent fe28a9edbf
commit ac6211f1af
1 changed files with 4 additions and 2 deletions

View File

@ -240,7 +240,7 @@
index: tab.browserWindow.tabs.indexOf(tab),
windowId: safari.application.browserWindows.indexOf(tab.browserWindow),
active: tab === tab.browserWindow.activeTab,
url: tab.url,
url: tab.url || "about:blank",
title: tab.title
});
};
@ -272,7 +272,9 @@
var url = details.url.replace(rgxHash, '');
for(var i = 0; i < win.tabs.length; i++) {
if(win.tabs[i].url.replace(rgxHash, '') === url) {
// Some tabs don't have a URL
if(win.tabs[i].url &&
win.tabs[i].url.replace(rgxHash, '') === url) {
win.tabs[i].activate();
return true;
}