Bug 1090313 - Only prompt desktopMode users to report issues for webfacing urls. r=margaret

This commit is contained in:
Mike Taylor 2014-10-28 10:32:00 -04:00
parent b26432a3ec
commit 58b8b3f705

View File

@ -39,7 +39,8 @@ var WebcompatReporter = {
} else if (topic === "DesktopMode:Change") {
let args = JSON.parse(data);
let tab = BrowserApp.getTabForId(args.tabId);
if (args.desktopMode && tab !== null) {
let currentURI = tab.browser.currentURI.spec;
if (args.desktopMode && this.isReportableUrl(currentURI)) {
this.reportDesktopModePrompt();
}
}
@ -57,10 +58,10 @@ var WebcompatReporter = {
},
isReportableUrl: function(url) {
return url !== null && !(url.startsWith("about") ||
url.startsWith("chrome") ||
url.startsWith("file") ||
url.startsWith("resource"));
return url && !(url.startsWith("about") ||
url.startsWith("chrome") ||
url.startsWith("file") ||
url.startsWith("resource"));
},
reportDesktopModePrompt: function() {