なにこれ
- Googleドキュメントとかスプシとか使ってて「こうだったらいいのにな」が無いため仕方なく書いたコード置き場
本文
Googleドキュメント
「このドキュメントのタイトルとURLをまとめてSlackとかmarkdownに貼り付けたいんだけど…」
javascript:(function(){window.prompt('msg','[' + document.getElementById('docs-title-widget').childNodes[0].childNodes[0].innerText + '](' + location.href + ')')})();
なんで id
振られてないんだろ。めんどくさいので childNodes[0]
で取得した。
Googleドライブ
画像置き場としてリンクを取得したい
javascript:(function(){window.prompt('msg','[' + document.getElementById('docs-title-widget').childNodes[0].childNodes[0].innerText + '](' + location.href + ')')})();
G Suiteに限らないやつ
GCPのdocumentとかでページ単位scrollすんのに邪魔なheaderを除去する
javascript:(function()%7B(function%20()%20%7Bvar%20i%2C%20elements%20%3D%20document.querySelectorAll('body%20*')%3Bfor%20(i%20%3D%200%3B%20i%20%3C%20elements.length%3B%20i%2B%2B)%20%7Bif%20(getComputedStyle(elements%5Bi%5D).position%20%3D%3D%3D%20'fixed')%20%7Belements%5Bi%5D.parentNode.removeChild(elements%5Bi%5D)%3B%7D%7D%7D)()%7D)()