大家有没有发现,最近 google 搜维基百科出来的都是手机站点?

2022-06-20 11:03:14 +08:00
 zhixiao

虽说 m 站点 pc 看起来效果也还行,但是总有点不爽。。。

3943 次点击
所在节点    问与答
37 条回复
v2tudnew
2022-06-20 21:14:23 +08:00
@cpalead #20 首先,我不是作者,其次,寻求帮助也要先贴出链接,而不是一句不转发。
ysc3839
2022-06-20 21:14:54 +08:00
@tpkxywxd 推荐使用 Header Editor 扩展,这个 Redirector 已经很多年没更新了。Header Editor 不仅能用来跳转,还可以修改请求头,可以避免一些网站根据请求头进行跳转。
MoonQiu1342
2022-06-20 22:02:41 +08:00
我也是,Safari 上点开 Wiki 指向的一直是 m 站,每次我只能删掉.m ,我还以为是我自己问题(捂脸)
MrCurly
2022-06-20 22:06:03 +08:00
我也发现了,不过不怎么影响阅读,就没管
explorerproxy
2022-06-20 22:14:28 +08:00
不止是维基,很多的网站都是这样,有没有适配了大量站点的脚本,可以强制手机版换成桌面版
v2tudnew
2022-06-20 22:39:30 +08:00
目前#23 的胜出😆,这个能实时预览测试,这点非常好。
TGl2aWRTQg
2022-06-21 00:56:03 +08:00
我也是,不知道啥情况
0x400
2022-06-21 08:39:51 +08:00
换了✈️ 发现这个问题 不知道是不是碰巧
cpalead
2022-06-21 15:32:51 +08:00
@v2tudnew 我已经( https://greasyfork.org/zh-CN/scripts/439848 )把 bug 修复了
大家直接把我的脚本导入就行了


// ==UserScript==
// @name RedirectChineseWikipedia
// @name:zh-CN 中文维基重定向
// @namespace https://zh.wikipedia.org
// @include https://zh.wikipedia.org/wiki/*
// @include https://zh.wikipedia.org/zh/*
// @include https://zh.wikipedia.org/zh-hk/*
// @include https://zh.wikipedia.org/zh-mo/*
// @include https://zh.wikipedia.org/zh-tw/*
// @include https://zh.wikipedia.org/zh-my/*
// @include https://zh.wikipedia.org/zh-sg/*
// @include https://zh.wikipedia.org/zh-hans/*
// @include https://zh.m.wikipedia.org/wiki/*
// @include https://zh.m.wikipedia.org/zh/*
// @include https://zh.m.wikipedia.org/zh-hk/*
// @include https://zh.m.wikipedia.org/zh-mo/*
// @include https://zh.m.wikipedia.org/zh-tw/*
// @include https://zh.m.wikipedia.org/zh-my/*
// @include https://zh.m.wikipedia.org/zh-sg/*
// @include https://zh.m.wikipedia.org/zh-cn/*
// @include https://zh.m.wikipedia.org/zh-hans/*
// @version 0.3
// @description Force redirect Chinese Wikipedia from other locales to zh-cn (and also from mobile ver to desktop ver)
// @description:zh-CN 重定向中文维基的其他版本(繁体中文等)到简体中文,同时重定向手机端页面到桌面端页面。
// @author aisuneko
// @icon https://zh.wikipedia.org/favicon.ico
// @license MIT
// @grant none
// ==/UserScript==

(function() {
'use strict';
let variants = ["wiki/", "zh/", "zh-hk/", "zh-mo/", "zh-tw/","zh-my/", "zh-sg/", "zh-hans/"];
let url = window.location.href;
let desturl = url;
let header = "zh.wikipedia.org/";
let mobile_header = "zh.m.wikipedia.org/";
if(url.search(mobile_header) != -1) desturl = url.replace(mobile_header, header);

let target = header + "zh-cn/";
for(let i = 0; i < variants.length; i++){
let searchstr = header + variants[i];
if(desturl.search(searchstr) != -1){
desturl = desturl.replace(searchstr, target);
break;
}
}
window.location.replace(desturl);
})();
v2tudnew
2022-06-21 19:46:11 +08:00
@cpalead #29 已经删了,还是 Header Editor 的好用,两条正则搞定中文和外语的问题。
posizard
2022-07-14 14:23:33 +08:00
m 站可以切换语言,pc 站底部有些词条,有类似知识结构的介绍。 强烈希望这两个功能整合一下。
cpalead
2022-10-24 14:30:03 +08:00
@v2tudnew 能不能把规则分享一下
v2tudnew
2022-10-24 15:22:32 +08:00
@cpalead 本来想中文部分都例举出来,但想到反正有排除,zh-后面也不可能是外语。

匹配类型: 正则表达式

匹配规则: ^https?:\/\/([a-z]+)\.m\.wikipedia\.org\/

执行类型: 常规

重定向至: https://$1.wikipedia.org/


匹配类型: 正则表达式

匹配规则: ^https?:\/\/zh\.wikipedia\.org\/(wiki|zh-[a-z]+)\/

排除规则://zh.wikipedia.org/zh-cn/

执行类型: 常规

重定向至: https://zh.wikipedia.org/zh-cn/
cpalead
2022-11-03 18:12:03 +08:00
@v2tudnew 你这个好用啊,用油猴的脚本,是先把页面加载了,然后再跳转到中文页面,你这个规则,还没加载直接就跳转了!省时间,而且油猴脚本有时候还不生效
cpalead
2022-11-03 19:38:08 +08:00
@v2tudnew 你这少了一条
^https?:\/\/zh\.wikipedia\.org\/(wiki|zh)\/
因为有些就是 zh 的不是 zh-tw 这样的
v2tudnew
2022-11-03 21:15:36 +08:00
@cpalead ^https?:\/\/zh\.wikipedia\.org\/(wiki|zh|zh-[a-z]+)\/ 确实,但没遇到过啊。😆
cpalead
2022-11-03 22:44:26 +08:00
@v2tudnew 我刚导入就遇到了,哈哈

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

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

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

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

© 2021 V2EX