写了个油猴脚本让 V2EX 拥有 SPA 单页的无刷新类似路由切换页面的 Feel

2022-04-23 11:06:06 +08:00
 pytth
// ==UserScript==
// @name         V2EX 无刷新加载页面
// @version      0.1
// @description  V2EX 无刷新切换页面,跳转页面
// @author       You
// @match        https://www.v2ex.com/*
// @grant        none
// @require      https://cdn.bootcdn.net/ajax/libs/instantclick/3.1.0/instantclick.min.js
/* globals jQuery, $, InstantClick,waitForKeyElements */
// ==/UserScript==

(function() {
    'use strict';
    /* 初始化 InstantClick 插件 */
    InstantClick.init();
    /* 隐藏 InstantClick 插件的加载进度条 */
    var style = document.createElement("style");
    style.type = "text/css";
    var text = document.createTextNode("#instantclick-bar{display:none;}");
    style.appendChild(text);
    var head = document.getElementsByTagName("head")[0];
    head.appendChild(style);
})();

https://greasyfork.org/zh-CN/scripts/420178-v2ex%E6%97%A0%E5%88%B7%E6%96%B0%E5%8A%A0%E8%BD%BD%E9%A1%B5%E9%9D%A2

4244 次点击
所在节点    程序员
23 条回复
Bronya
2022-04-24 09:37:00 +08:00
用上了,挺好使,感谢~
coldmonkeybit
2022-04-24 11:15:41 +08:00
不错不错赞一个
songjinxin
2022-05-09 19:01:31 +08:00
不错不错 ! 感谢楼主分享!

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/848726

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX