Fix undefined error (#675)

This commit is contained in:
Nguyễn Kim Kha 2020-05-28 11:44:34 +10:00 committed by GitHub
parent cec5d46f3d
commit 545d512872
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -350,7 +350,7 @@ extensionApi.webRequest.onBeforeSendHeaders.addListener(function (details) {
if (tabId !== -1) {
extensionApi.tabs.get(tabId, function (currentTab) {
// Validate url of current tab to avoid injecting script to unrelated sites
if (currentTab && isSiteEnabled(currentTab)) {
if (currentTab && currentTab.url && isSiteEnabled(currentTab)) {
// run contentScript inside tab
extensionApi.tabs.executeScript(tabId, {
file: 'src/js/contentScript.js',