Skip to content

Instantly share code, notes, and snippets.

@kemsakurai
Last active September 18, 2023 16:37
Show Gist options
  • Save kemsakurai/419fd41c3c49fc55a3769fe28de7d7ac to your computer and use it in GitHub Desktop.
Save kemsakurai/419fd41c3c49fc55a3769fe28de7d7ac to your computer and use it in GitHub Desktop.
Tampermonkey's user script to paste embedded image links from Google Drive in Scrapbox format.
// ==UserScript==
// @name   Copy Google Drive sb embed img
// @namespace       http://tampermonkey.net/
// @version 0.1
// @description       Google Drive image url for Scrapbox
// @author K.Sakurai
// @match   https://drive.google.com/*
// @run-at context-menu
// @grant GM_setClipboard
// ==/UserScript==
(function() {
var id = window.location.href.split("/")[5];
var url = "https://drive.google.com/uc?export=view&id=" + id;
var href = "[" + url + "&ext=.jpg]";
        GM_setClipboard(href);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment