Skip to content

Commit

Permalink
V1.11.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Revadike committed Apr 30, 2021
1 parent 8c37c53 commit 8e6b610
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Steam Web Integration.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
// @downloadURL https://github.com/Revadike/SteamWebIntegration/raw/master/Steam%20Web%20Integration.user.js
// @exclude /^https?\:\/\/(.+.steampowered|steamcommunity).com\/(?!groups\/groupbuys).*/
// @grant GM_addStyle
// @grant GM_deleteValue
// @grant GM_getValue
// @grant GM_info
// @grant GM_listValues
// @grant GM_openInTab
// @grant GM_registerMenuCommand
// @grant GM_setValue
Expand All @@ -29,7 +31,7 @@
// @run-at document-start
// @supportURL https://github.com/Revadike/SteamWebIntegration/issues/
// @updateURL https://github.com/Revadike/SteamWebIntegration/raw/master/Steam%20Web%20Integration.user.js
// @version 1.11.3
// @version 1.11.4
// ==/UserScript==

// ==Code==
Expand All @@ -38,6 +40,15 @@ this.$ = this.jQuery = jQuery.noConflict(true);
let settings;
let boxNode;

function factoryReset() {
if (unsafeWindow.confirm(`Are you sure you want to reset all settings and cached data?`)) {
const keys = GM_listValues();
keys.forEach((key) => GM_deleteValue(key));
console.log(`[Steam Web Integration] Factory reset completed!`);
unsafeWindow.alert(`Factory reset completed!`);
}
}

function displaySettings() {
const { name, version, author } = GM_info.script;
$(`#title`).text(`${name} (${version}) by ${author}`);
Expand Down Expand Up @@ -647,6 +658,9 @@ function init() {

// Open the setup page on any web page.
GM_registerMenuCommand(`Change settings`, () => unsafeWindow.open(settingsuri, `_blank`));

// Factory reset on any web page.
GM_registerMenuCommand(`Factory reset`, factoryReset);
}

init();
Expand Down

0 comments on commit 8e6b610

Please sign in to comment.