You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnalert(`BetterYTM does not work when using ${GM.info.scriptHandler} as the userscript manager extension and will be disabled.\nI recommend using either ViolentMonkey, TamperMonkey or GreaseMonkey.`);
7757
+
returnshowPrompt({type: "alert",message: `BetterYTM does not work when using ${GM.info.scriptHandler} as the userscript manager extension and will be disabled.\nI recommend using either ViolentMonkey, TamperMonkey or GreaseMonkey.`,denyBtnText: "Close"});
7758
7758
log("Session ID:",getSessionId());
7759
7759
initInterface();
7760
7760
setLogLevel(defaultLogLevel);
@@ -7988,7 +7988,7 @@ function registerDevCommands() {
7988
7988
if(mode!=="development")
7989
7989
return;
7990
7990
GM.registerMenuCommand("Reset config",async()=>{
7991
-
if(confirm("Reset the configuration to its default values?\nThis will automatically reload the page.")){
7991
+
if(awaitshowPrompt({type: "confirm",message: "Reset the configuration to its default values?\nThis will automatically reload the page.",confirmBtnText: "Reset"})){
7992
7992
awaitclearConfig();
7993
7993
awaitreloadTab();
7994
7994
}
@@ -8031,7 +8031,7 @@ function registerDevCommands() {
8031
8031
});
8032
8032
GM.registerMenuCommand("Delete all GM values",async()=>{
8033
8033
constkeys=awaitGM.listValues();
8034
-
if(confirm(`Clear all ${keys.length} GM values?\nSee console for details.`)){
8034
+
if(awaitshowPrompt({type: "confirm",message: `Clear all ${keys.length} GM values?\nSee console for details.`,confirmBtnText: "Clear"})){
8035
8035
dbg(`Clearing ${keys.length} GM values:`);
8036
8036
if(keys.length===0)
8037
8037
dbg(" No values found.");
@@ -8043,7 +8043,7 @@ function registerDevCommands() {
8043
8043
});
8044
8044
GM.registerMenuCommand("Delete GM values by name (comma separated)",async()=>{
8045
8045
var_a;
8046
-
constkeys=awaitshowPrompt({type: "prompt",message: "Enter the name(s) of the GM value to delete (comma separated).\nEmpty input cancels the operation."});
8046
+
constkeys=awaitshowPrompt({type: "prompt",message: "Enter the name(s) of the GM value to delete (comma separated).\nEmpty input cancels the operation.",confirmBtnText: "Delete"});
GM.registerMenuCommand("Export all data using DataStoreSerializer",async()=>{
8098
-
constser=awaitgetStoreSerializer().serialize();
8099
-
dbg("Serialized data stores:",JSON.stringify(JSON.parse(ser)));
8100
-
alert("See console.");
8101
-
});
8102
8097
GM.registerMenuCommand("Import all data using DataStoreSerializer",async()=>{
8103
-
constinput=awaitshowPrompt({type: "prompt",message: "Enter the serialized data to import:"});
8098
+
constinput=awaitshowPrompt({type: "prompt",message: "Paste the content of the export file to import:",confirmBtnText: "Import"});
8104
8099
if(input&&input.length>0){
8105
8100
awaitgetStoreSerializer().deserialize(input);
8106
-
alert("Imported data. Reload the page to apply changes.");
8101
+
if(awaitshowPrompt({type: "confirm",message: "Successfully imported data using DataStoreSerializer.\nReload the page to apply changes?",confirmBtnText: "Reload"}))
8102
+
awaitreloadTab();
8107
8103
}
8108
8104
});
8109
8105
GM.registerMenuCommand("Throw error (toast example)",()=>error("Test error thrown by user command:",newSyntaxError("Test error")));
@@ -8124,8 +8120,8 @@ function registerDevCommands() {
8124
8120
GM.registerMenuCommand("Toggle dev treatments",async()=>{
alert(`Dev treatments are now ${val ? "enabled" : "disabled"}. Page will reload.`);
8128
-
awaitreloadTab();
8123
+
if(awaitshowPrompt({type: "confirm",message: `Dev treatments are now ${val ? "enabled" : "disabled"}.\nDo you want to reload the page?`,confirmBtnText: "Reload",denyBtnText: "nothxbye"}))
0 commit comments