Quellcode durchsuchen

Add an exception handler for copying to the clipboard

master
Fen Dweller vor 5 Jahren
Ursprung
Commit
c6d7b64d10
1 geänderte Dateien mit 7 neuen und 2 gelöschten Zeilen
  1. +7
    -2
      macrovision.js

+ 7
- 2
macrovision.js Datei anzeigen

@@ -3756,8 +3756,13 @@ function linkScene() {
loc = new URL(window.location); loc = new URL(window.location);
const link = loc.protocol + "//" + loc.host + loc.pathname + "?scene=" + b64EncodeUnicode(JSON.stringify(exportScene())); const link = loc.protocol + "//" + loc.host + loc.pathname + "?scene=" + b64EncodeUnicode(JSON.stringify(exportScene()));
window.history.replaceState(null, "Macrovision", link); window.history.replaceState(null, "Macrovision", link);
navigator.clipboard.writeText(link);
toast("Copied permalink to clipboard");
try {
navigator.clipboard.writeText(link);
toast("Copied permalink to clipboard");
} catch {
toast("Couldn't copy permalink");
}
} }


function copyScene() { function copyScene() {


Laden…
Abbrechen
Speichern