null-checks for extension host testing

This commit is contained in:
idk
2020-01-14 10:26:35 -05:00
parent fdbc208bfe
commit 15a0e838b3
3 changed files with 14 additions and 9 deletions

12
host.js
View File

@@ -29,10 +29,14 @@ function localHost(url) {
}
function extensionHost(url) {
var res = url.originUrl.startsWith(browser.runtime.getURL(""));
if (res) return res;
var res = url.url.startsWith(browser.runtime.getURL(""));
if (res) return res;
if (url.originUrl !== undefined) {
var res = url.originUrl.startsWith(browser.runtime.getURL(""));
if (res) return res;
}
if (url.url !== undefined) {
var res = url.url.startsWith(browser.runtime.getURL(""));
if (res) return res;
}
}
function i2pHostName(url) {