原文鏈接:https://emlog.icedog.top/?post=28
瀏覽器打開(kāi)空白頁(yè)
在瀏覽器的地址欄輸入如下代碼即可
about:blank
在瀏覽器打開(kāi)空白頁(yè)作為臨時(shí)內(nèi)容存放區(qū)
有時(shí)候我們想找個(gè)地方存一些文本數(shù)據(jù),但是又不一定有自己熟悉好用的工具炫隶,這時(shí)腺兴,瀏覽器就是一個(gè)不錯(cuò)的工具儡遮,按 F12 打開(kāi)開(kāi)發(fā)者工具,輸入如下命令即可蒲犬。
源碼:
(function(){
var nw =window.open("about:blank","臨時(shí)編輯頁(yè)");
nw.document.title="臨時(shí)編輯頁(yè)";
nw.document.body.contentEditable=true;
nw.document.body.innerText="現(xiàn)在你可以直接在頁(yè)面輸入內(nèi)容了";
})();
標(biāo)簽欄書(shū)簽?zāi)J阶罕纾蜷_(kāi)開(kāi)發(fā)者工具比較繁瑣,安裝瀏覽器插件又比較麻煩啦逆,直接創(chuàng)建個(gè)瀏覽器書(shū)簽反而最簡(jiǎn)單,如下圖填入內(nèi)容即可
名稱(chēng):打開(kāi)臨時(shí)編輯頁(yè)
網(wǎng)址:
javascript:(function(){var nw =window.open("about:blank","臨時(shí)編輯頁(yè)");nw.document.title="臨時(shí)編輯頁(yè)";nw.document.body.contentEditable=true;nw.document.body.innerText="現(xiàn)在你可以直接在頁(yè)面輸入內(nèi)容了";})()
復(fù)制網(wǎng)頁(yè)標(biāo)題和url的腳本
在生活中笛洛,我們經(jīng)常會(huì)訪問(wèn)各種網(wǎng)頁(yè)查資料夏志,做筆記,同時(shí)會(huì)存儲(chǔ)這些網(wǎng)頁(yè)地址撞蜂,用于下次遇到類(lèi)似的問(wèn)題盲镶,好做參考,但是時(shí)間一久蝌诡,只看鏈接就忘了之前存的是啥了溉贿,
所以一般會(huì)把網(wǎng)頁(yè)標(biāo)題和鏈接一起存下來(lái),如下格式:
Chrome 文件選擇延遲 Bug - 知乎
https://zhuanlan.zhihu.com/p/27946188
一行標(biāo)題浦旱,一行內(nèi)容宇色,但是手動(dòng)操作太過(guò)于繁瑣,不如用瀏覽器書(shū)簽?zāi)_本實(shí)現(xiàn)
名稱(chēng):復(fù)制網(wǎng)頁(yè)標(biāo)題和鏈接
網(wǎng)址:
javascript:(function(f){var info =document.createElement('textarea');info.setAttribute('style','position:fixed;z-index:9999;width:400px;height:100px;user-select:text;');info.value=f;document.body.insertBefore(info,document.body.firstChild);var first=document.body.firstChild;first.select();document.execCommand('copy');document.body.firstElementChild.remove();
})(`${document.title}\r\n${document.URL}`)
復(fù)制網(wǎng)頁(yè)標(biāo)題和 url 為 markdown 超鏈接格式的腳本
現(xiàn)在做筆記基本上都使用 markdown 格式做筆記颁湖,因此鏈接存為 markdown 鏈接格式會(huì)更方便宣蠕,腳本和上面一樣,只是替換了傳參字符串模板
名稱(chēng):(md)復(fù)制網(wǎng)頁(yè)標(biāo)題和鏈接
網(wǎng)址:
javascript:(function(f){var info =document.createElement('textarea');info.setAttribute('style','position:fixed;z-index:9999;width:400px;height:100px;user-select:text;');info.value=f;document.body.insertBefore(info,document.body.firstChild);var first=document.body.firstChild;first.select();document.execCommand('copy');document.body.firstElementChild.remove();
})(`[${document.title}](${document.URL} \"${document.title}\")`)
效果:
[Chrome 文件選擇延遲 Bug - 知乎](https://zhuanlan.zhihu.com/p/27946188 "Chrome 文件選擇延遲 Bug - 知乎")
注意
有的網(wǎng)站是不允許通過(guò)書(shū)簽這樣執(zhí)行腳本的(如 github)甥捺,這種就沒(méi)辦法抢蚀,只能按F12打開(kāi)開(kāi)發(fā)者工具執(zhí)行。