Skip to content

Commit

Permalink
Merge pull request #36 from WesleyBranton/development
Browse files Browse the repository at this point in the history
Added uninstall survey
  • Loading branch information
WesleyBranton authored Jul 30, 2022
2 parents 0b1e24f + baf3e6c commit 15a1608
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,30 @@ function handleInstalled(details) {
}
}

/**
* Set up uninstall page
*/
function setUninstallPage() {
getSystemDetails((details) => {
browser.runtime.setUninstallURL(`${webBase}/uninstall/?browser=${details.browser}&os=${details.os}&version=${details.version}`);
});
}

/**
* Send system details to callback
* @param {Function} callback
*/
function getSystemDetails(callback) {
browser.runtime.getPlatformInfo((platform) => {
callback({
browser: 'firefox',
version: browser.runtime.getManifest().version,
os: platform.os
});
});
}

const webBase = 'https://addons.wesleybranton.com/addon/website-blocker';
let filter = [];
let showError = true;
createBlocker();
Expand All @@ -75,3 +99,4 @@ browser.browserAction.onClicked.addListener(() => {
browser.runtime.openOptionsPage();
});
checkData();
setUninstallPage();

0 comments on commit 15a1608

Please sign in to comment.