-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from Theodo-UK/fix/Cannot-access-a-chrome-URL
Fix/cannot access a chrome url
- Loading branch information
Showing
8 changed files
with
138 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
export const backgroundStopRecordingBytes = () => { | ||
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => { | ||
if (tabs.length > 0) { | ||
const tabId = tabs[0].id; | ||
if (tabId) { | ||
chrome.runtime.sendMessage({ | ||
command: "stopRecordingBytesTransferred", | ||
tabId, | ||
}); | ||
} | ||
export const backgroundStopRecordingBytes = async () => { | ||
const tabs = await chrome.tabs.query({ active: true, currentWindow: true }); | ||
if (tabs.length > 0) { | ||
const activeTabId = tabs[0].id; | ||
if (activeTabId) { | ||
chrome.runtime.sendMessage({ | ||
command: "stopRecordingBytesTransferred", | ||
activeTabId, | ||
}); | ||
} | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
export const refreshActiveTabAndRecordBytes = async (bypassCache: boolean) => { | ||
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => { | ||
if (tabs.length > 0) { | ||
const tabId = tabs[0].id; | ||
if (tabId) { | ||
chrome.tabs.reload( | ||
tabId, | ||
{ | ||
bypassCache: bypassCache, | ||
}, | ||
() => { | ||
chrome.runtime.sendMessage({ | ||
command: "startRecordingBytesTransferred", | ||
tabId, | ||
}); | ||
} | ||
); | ||
export const refreshActiveTabAndRecordBytes = async ( | ||
bypassCache: boolean | ||
): Promise<void> => { | ||
const tabs = await chrome.tabs.query({ active: true, currentWindow: true }); | ||
|
||
if (tabs.length > 0) { | ||
const tabId = tabs[0].id; | ||
if (tabId) { | ||
await chrome.tabs.reload(tabId, { | ||
bypassCache: bypassCache, | ||
}); | ||
|
||
const { success, message } = await chrome.runtime.sendMessage({ | ||
command: "startRecordingBytesTransferred", | ||
tabId, | ||
}); | ||
|
||
if (!success) { | ||
throw new Error(message); | ||
} | ||
} | ||
}); | ||
} | ||
}; |