only activate paste-mode the first time a file is opened with PairDrop by looking for the url parameter on start and removing it afterwords.

This commit is contained in:
schlagmichdoch 2023-02-02 15:19:28 +01:00
parent 442dbe704d
commit c0c51c38b3

View file

@ -1287,7 +1287,8 @@ class WebShareTargetUI {
class WebFileHandlersUI {
constructor() {
if ("launchQueue" in window) {
const urlParams = new URL(window.location).searchParams;
if (urlParams.has("file_handler") && "launchQueue" in window) {
launchQueue.setConsumer(async launchParams => {
console.log("Launched with: ", launchParams);
if (!launchParams.files.length)
@ -1303,6 +1304,7 @@ class WebFileHandlersUI {
Events.fire('activate-paste-mode', {files: files, text: ""})
launchParams = null;
});
window.history.replaceState({}, "Rewrite URL", '/');
}
}
}