我在所有书签存储中都使用了pinboard,它们提供了一个小的javascript书签,可以轻松添加和标记我在firefox工具栏中的内容。美化代码:
javascript: q = location.href;
if (document.getSelection) {
d = document.getSelection();
} else {
d = '';
};
p = document.title;
void(open('https://pinboard.in/add?showtags=yes&url=' + encodeURIComponent(q) + '&description=' + encodeURIComponent(d) + '&title=' + encodeURIComponent(p), 'Pinboard', 'toolbar=no,scrollbars=yes,width=750,height=700'));
对所有http网站都很棒,但当我尝试为https网站添加书签时,我会在控制台中看到它:
Content Security Policy: The page's settings blocked the loading of a resource: An attempt to execute inline scripts has been blocked.
我不确定SO是否是正确的SE网站,但我想知道如何允许该特定脚本在任何地方执行。如果我将javascript复制到地址字段并手动运行它,一切正常。