From b4ca46a1653077613fdff290cd3c1dfe95cab596 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Wed, 12 Aug 2020 13:54:09 -0700 Subject: [PATCH] Add undefined to all bookmarklets for firefox compatibility. On Firefox, clicking a bookmarklet will cause the page to display the last return value of the bookmarklet, deleting the rest of the page contents. The solution is to add undefined; at the end. --- Javascript/loopplayall.js | 2 +- Javascript/opendir_image.js | 3 ++- Javascript/playalbum.js | 2 +- Javascript/tab_renamer.js | 3 ++- Javascript/unrowspan.js | 2 +- Javascript/videotiles.js | 4 ++-- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Javascript/loopplayall.js b/Javascript/loopplayall.js index dadff1e..14418b9 100644 --- a/Javascript/loopplayall.js +++ b/Javascript/loopplayall.js @@ -1,3 +1,3 @@ javascript: - Array.from(document.getElementsByTagName("Video")).forEach(function(e){e.loop=true;e.play()}) +undefined; diff --git a/Javascript/opendir_image.js b/Javascript/opendir_image.js index a510a3d..8a81a19 100644 --- a/Javascript/opendir_image.js +++ b/Javascript/opendir_image.js @@ -871,4 +871,5 @@ function main() fill_workspace(divs); } -main(); \ No newline at end of file +main(); +undefined; diff --git a/Javascript/playalbum.js b/Javascript/playalbum.js index 0a2601f..7be406c 100644 --- a/Javascript/playalbum.js +++ b/Javascript/playalbum.js @@ -1,5 +1,4 @@ javascript: - function give_event(player, index) { /* @@ -18,3 +17,4 @@ for (var index = 0; index < players.length - 1; index += 1) give_event(players[index], index); } players[0].play(); +undefined; diff --git a/Javascript/tab_renamer.js b/Javascript/tab_renamer.js index d951d10..c0c23d2 100644 --- a/Javascript/tab_renamer.js +++ b/Javascript/tab_renamer.js @@ -8,4 +8,5 @@ function rename() } } -rename(); \ No newline at end of file +rename(); +undefined; diff --git a/Javascript/unrowspan.js b/Javascript/unrowspan.js index a34084a..15fc1e3 100644 --- a/Javascript/unrowspan.js +++ b/Javascript/unrowspan.js @@ -1,5 +1,4 @@ javascript: - function unrowspan(tbody) { var rows = tbody.children; @@ -24,3 +23,4 @@ function unrowspan(tbody) var tbodies = Array.from(document.getElementsByTagName("tbody")); tbodies.forEach(unrowspan); +undefined; diff --git a/Javascript/videotiles.js b/Javascript/videotiles.js index dc38937..6b7c9c1 100644 --- a/Javascript/videotiles.js +++ b/Javascript/videotiles.js @@ -1,5 +1,4 @@ javascript: - CSS = "" + "* {margin: 0; padding: 0}" + "html {height: 95%}" @@ -111,4 +110,5 @@ function main() } } -main(); \ No newline at end of file +main(); +undefined;