-
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 #44 from Theodo-UK/2023/07/18-Amount-of-data-trans…
…ferred-in-DevTools-is-different-from-amount-recorded-by-extension Added chrome.debugger to monitor network requests
- Loading branch information
Showing
6 changed files
with
75 additions
and
144 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { IBytesRepository } from "../data/bytes/IBytesRepository"; | ||
|
||
export const addBytesTransferred = async (bytes: number) => { | ||
IBytesRepository.instance.addBytesTransferred(bytes); | ||
|
||
try { | ||
await chrome.runtime.sendMessage({ | ||
command: { | ||
bytesTransferredChanged: | ||
IBytesRepository.instance.getBytesTransferred(), | ||
}, | ||
}); | ||
} catch (e: unknown) { | ||
if ( | ||
(e as Error).message === | ||
"Could not establish connection. Receiving end does not exist." | ||
) { | ||
console.warn( | ||
`Error Caught: ${e}\nIf popup is open and this error is seen in the console, debugging is required.` | ||
); | ||
} else { | ||
throw e; | ||
} | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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