-
Notifications
You must be signed in to change notification settings - Fork 651
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Fianlly make the HTTP header modifying work (after fighting with a…
…n obscure undocumented API issue) 2. Add Sentry lib to capture potential crash reports (but can only used on options.html and popup.html)
- Loading branch information
Showing
15 changed files
with
172 additions
and
93 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 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
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,17 @@ | ||
// IMPORTANT NOTE: | ||
// To make it work, we need to add the following line first to the HTML file: | ||
// <script type="text/javascript" src="third_party/js/sentry-x.y.z.min.js"></script> | ||
// So it do NOT work for the service_worker.mjs file. Currently it works only for the | ||
// popup.html and options.html pages. | ||
|
||
const PRODUCTION_SAMPLE_RATE = 0.01; | ||
|
||
function isProductionExtension() { | ||
return chrome.runtime.id === 'pdnfnkhpgegpcingjbfihlkjeighnddk'; | ||
} | ||
|
||
Sentry.init({ | ||
dsn: 'https://[email protected]/6544429', | ||
sampleRate: isProductionExtension() ? PRODUCTION_SAMPLE_RATE : 1.0, | ||
release: chrome.runtime.getManifest().version, | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// IMPORTANT NOTE: | ||
// Any asynchronous operations not wrapped by an event listener here | ||
// are not guaranteed to complete, or may not get executed at all. | ||
// So please make sure all important logic is done via listeners. | ||
|
||
|
||
import * as Settings from './modules/settings.mjs'; | ||
|
||
|
||
function initializeExtension() { | ||
console.group('To intialize the extension...'); | ||
Settings.loadCurrentSettings().then(() => { | ||
console.log('Successfully initialized the chrome extension'); | ||
console.groupEnd(); | ||
}); | ||
} | ||
|
||
|
||
// Triggered when the extension is first time installed | ||
chrome.runtime.onInstalled.addListener(function(details) { | ||
// Show the donation page when the extension is installed | ||
if (details.reason === 'install') { | ||
chrome.tabs.create({ | ||
url: chrome.i18n.getMessage('donation_url'), | ||
}); | ||
} | ||
|
||
// Initialize the extension | ||
initializeExtension(); | ||
}); | ||
|
||
|
||
// Triggered when the Chrome browser itself is just opened | ||
chrome.runtime.onStartup.addListener(function() { | ||
initializeExtension(); | ||
}); |
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,5 @@ | ||
Run the following command to validate the integrity of the third-party JavaScript libs: | ||
|
||
``` | ||
sha256sum --check checksum.sha256 | ||
``` |
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,3 @@ | ||
4a4de7903ea62d330e17410ea4db6c22bcbeb350ac6aa402d6b54b4c0cbed327 bootstrap-3.3.5.min.js | ||
f16ab224bb962910558715c82f58c10c3ed20f153ddfaa199029f141b5b0255c jquery-2.1.4.min.js | ||
ca19d635167de42633b7c4acda11365444ebafe4093f9f241963b48cd57093b6 sentry-7.4.1.min.js |
Oops, something went wrong.