Last active
October 28, 2024 18:36
-
-
Save luetage/6a66af73a4dd264fcb05fe24926b2e36 to your computer and use it in GitHub Desktop.
Collection of bookmarklets for Vivaldi browser command chains. Development version. Get the full recipes here ☛ https://forum.vivaldi.net/post/500553
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Automatic Line Wrap | |
// Automatically switch on wrapping lines in page source. | |
javascript: (() => { | |
document.querySelector("input").click(); | |
history.replaceState({}, "", location.href); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Embed Youtube | |
// Takes the current video and opens it embed. | |
javascript: (() => { | |
const url = new URL(window.location.href); | |
window.open(`${url.origin}/embed/${url.search.split("=")[1]}`, "_self"); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reverse Image Search | |
// Retrieves the image source under the mouse cursor, adds it to the page and | |
// selects it. | |
javascript: (() => { | |
function i(e) { | |
if (e.target.tagName === "IMG") { | |
document.removeEventListener("mousemove", i); | |
let u = e.target.getAttribute("src"); | |
if (u) { | |
const a = document.createElement("a"); | |
if (u.startsWith("..")) { | |
u = window.location.origin + u.slice(2); | |
} | |
a.innerText = u; | |
console.info(`reverse image search ${u}`); | |
a.style.opacity = "0"; | |
a.style.fontSize = "0em"; | |
document.body.appendChild(a); | |
const r = document.createRange(); | |
r.selectNodeContents(a); | |
window.getSelection().addRange(r); | |
} | |
} | |
} | |
window.getSelection().removeAllRanges(); | |
document.addEventListener("mousemove", i); | |
setTimeout(() => document.removeEventListener("mousemove", i), 1900); | |
history.replaceState({}, "", location.href); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tab Scroll | |
// Scrolls to top of page and back to initial position. | |
javascript: (() => { | |
let offset = window.scrollY; | |
if (offset > 0) { | |
window.sessionStorage.setItem("offset", offset); | |
window.scrollTo({ top: 0, behavior: "instant" }); | |
} else { | |
window.scrollTo({ | |
top: window.sessionStorage.getItem("offset") || 0, | |
behavior: "instant", | |
}); | |
} | |
history.replaceState({}, "", location.href); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tile Link | |
// Gets the link under the mouse cursor and opens it in a new tab. | |
javascript: (() => { | |
const hover = document.querySelectorAll(":hover"); | |
for (let i = hover.length - 1; i >= 0; i--) { | |
if (hover[i].hasAttribute("href")) { | |
window.open(hover[i].href, "_blank"); | |
return; | |
} | |
} | |
history.replaceState({}, "", location.href); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment