Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/background-firefox/consent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ async function showConsent() {
browser.runtime.onInstalled.addListener(async ({ reason, temporary }) => {
if (temporary) return;
if (reason == "install") {
// Do not show consent dialog for browser Firefox version 140 or later
const browserInfo = await browser.runtime.getBrowserInfo();
const majorVersion = parseInt(browserInfo.version.split(".")[0]);

if (majorVersion >= 140) {
return;
}

await showConsent();
}
});
13 changes: 13 additions & 0 deletions src/models/Browser/Runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ export default interface Runtime {
* Get the complete manifest.json file, deserialized from JSON to an object.
*/
getManifest: () => any;

/**
* Returns information about the browser in which the extension is installed
*/
getBrowserInfo: () => Promise<BrowserInfo>;
}

export interface Port {
Expand Down Expand Up @@ -186,3 +191,11 @@ export interface MessageSender {
*/
tlsChannelId?: string;
}

export interface BrowserInfo {

/**
* string representing the browser's version, for example "51.0" or "51.0a2"
*/
version: string;
}
7 changes: 6 additions & 1 deletion static/firefox/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
"default_locale": "en",
"browser_specific_settings": {
"gecko": {
"id": "{e68418bc-f2b0-4459-a9ea-3e72b6751b07}"
"id": "{e68418bc-f2b0-4459-a9ea-3e72b6751b07}",
"data_collection_permissions": {
"required": [
"personallyIdentifyingInfo"
]
}
}
},
"icons": {
Expand Down
7 changes: 6 additions & 1 deletion static/firefox/manifest_v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
"default_locale": "en",
"browser_specific_settings": {
"gecko": {
"id": "{e68418bc-f2b0-4459-a9ea-3e72b6751b07}"
"id": "{e68418bc-f2b0-4459-a9ea-3e72b6751b07}",
"data_collection_permissions": {
"required": [
"personallyIdentifyingInfo"
]
}
}
},
"icons": {
Expand Down
Loading