Skip to content

Commit

Permalink
fix request patcher
Browse files Browse the repository at this point in the history
  • Loading branch information
sigoden committed Nov 3, 2021
1 parent 83175c1 commit 7606117
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/background/chrome.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function initMessageHandler () {
function setNetworkHandler () {
chrome.webRequest.onBeforeSendHeaders.addListener(
function (details) {
if (details.initiator.startsWith('chrome-extension://')) {
if (details?.initiator && details.initiator.startsWith('chrome-extension://')) {
if (details.url.startsWith(DOMAIN)) {
for (let i = 0; i < details.requestHeaders.length; ++i) {
const header = details.requestHeaders[i]
Expand Down

0 comments on commit 7606117

Please sign in to comment.