javascript可在控制台中使用,但不能用作书签

时间:2018-09-06 10:34:46

标签: javascript css jupyter-notebook

当我将以下JavaScript代码粘贴到Chrome检查控制台时,它们可以工作;但我无法成功使其用作书签。有人知道为什么吗?

我想做的是设置css样式的空白:预包装,以便正确查看预格式化的表。

javascript: void(! function(t, i) {
    try {
        if (!t || !i) return;
        ! function(e, t) {
            if ("string" == typeof e && 0 < e.length && null === i.getElementById(t)) {
                var n = i.createElement("style");
                n.setAttribute("type", "text/css"), "string" == typeof t && 0 < t.length && n.setAttribute("id", t);
                var r = i.createTextNode(e);
                n.appendChild(r);
                var o = i.getElementsByTagName("head");
                0 < o.length && o[0].appendChild(n);
            }
        }("pre, code, kbd, samp {white-space: pre !important;}", "orospu-jupyter");
    } catch (e) {
        t && t.console && "function" == typeof t.console.error && t.console.error(e);
    }
}(window, window.document));

1 个答案:

答案 0 :(得分:-1)

因为书签仅适用于网页。不能将其用于脚本书签。抱歉。

也许这可能有用function as google chrome bookmark

相关问题