Giter VIP home page Giter VIP logo

gooreplacer's Introduction

重定向/屏蔽 URL,修改/屏蔽 header

gooreplacer 最初为解决国内无法访问 Google 资源(Ajax、API等)导致页面加载速度巨慢而生,新版在此基础上,增加了更多实用功能,可以方便用户屏蔽某些请求,修改 HTTP 请求/响应 的 headers。

English Version

特性

  • 支持在线规则,主要用于重定向 Google 资源,用户可更改
  • 本地规则
  • 导入导出规则,方便用户备份、同步(规则可在 Chrome/Firefox/Edge.. 通用)
  • 支持测试
  • i18n

对于只想重定向 Google 资源的同学,可以在在线规则处填上

https://raw.githubusercontent.com/jiacai2050/gooreplacer/master/gooreplacer.json

然后点击更新就好了,目前会重定向到loli.net的代理。 如果想自定义规则,可参考 guides.md。实用小技巧:

安装

插件商店

推荐在浏览器的插件商店去下载,欢迎打分~

浏览器 评分 用户数
Chrome Web Store Chrome Web Store Chrome Web Store
Mozilla Add-on Mozilla Add-on Mozilla Add-on
Microsoft Edge Microsoft Edge

zip 包

release 页面下载对应打包好的 zip 文件,本地解压。之后在 chrome://extensions/ 选中开发者模式,选择「加载已解压的扩展程序」即可。

实现

在 v1.0 之前采用纯 JavaScript 实现,代码在 legacy-js-src 目录,在 v2.0 之后采用 ClojureScript + Reagent + Antd + React-Bootstrap,在 cljs-src 目录。

License

MIT License © Jiacai Liu

gooreplacer's People

Contributors

arcticlampyrid avatar cbw2007 avatar ganyuanzhen avatar gloomy-ghost avatar jiacai2050 avatar krasnayaploshchad avatar lehmaning avatar lemonawa avatar meteormatt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gooreplacer's Issues

另一个拓展

这是另一个功能近似的拓展,给你们互相介绍认识一下----gooreplacer和这个加速器是我用过的 接近十个
CDN修改类拓展 中最好的两个,希望加速器能做自定义规则,导入导出等功能,gooreplacer能内置更多规则。
https://github.com/xmcp/GoFW

conflict with https everywhere

Warning:
This extension failed to redirect a network request to https://apis.google.com/js/plusone.js because another extension (gooreplacer) redirected it to http://cdn.rawgit.com/jiacai2050/gooreplacer/gh-pages/proxy/plusone.js.
另外想请教一下怎么redirect到file///H:/xxxx.js这样的本机文件上去.或者怎么在自己的github上建立cdn.rawgit.com/jiacai2050/gooreplacer/gh-pages/proxy/widgets.js这种缓存再自己redirect上去(我想试试自己缓存connect.facebook.net/en_US/sdk.js)

这步判断是否多余?

if( requestUrl.match(redirectReg) )

我看到下面有个filter,想必提交给listener的网址也是浏览器过滤过的。

强迫症没办法。

在国内双核浏览器上导出配置

配置导出功能在chrome上没有问题。

但是国内的chrome双核浏览器,点击导出按钮没有反应。建议作者优化。
或者如果受限,那么利用代码在屏幕上输出配置,用户可以自己剪贴后自己另存为.gson亦可

建议规则添加分组管理

对于前端开发,多个项目之间的切换,不同域名的使用。目前的列表展示,容易混淆,添加一个组的层级,方便开发管理这些规则

怎么阻止自动加上/

{
  "src": "g.cn",
  "dst": "google.com/ncr",
  "kind": "wildcard",
  "enable": true
}

想达到的效果是浏览器地址栏输入g.cn跳转到google.com/ncr, 而不是google.com/ncr/

谢谢@

This extension may have been corrupted

version 3.9 downloaded from github, and installed and imported online rule successfully, everything looks find, however, Chrome disabled extension in approx. 10min with red message "This extension may have been corrupted." and refuse to re-enable extension.

Chrome Version 63.0.3239.84 (Official Build) (64-bit)

无法连接fonts.lug.ustc.edu.cn

每次打开网页的时候都会在连接这个地址的时候卡住,在adblock plus里面屏蔽掉就能正常加载网页了。但是ping这个地址可以ping通。

ping fonts.lug.ustc.edu.cn

正在 Ping cname.vm.ustclug.org [202.141.162.123] 具有 32 字节的数据:
来自 202.141.162.123 的回复: 字节=32 时间=20ms TTL=50
来自 202.141.162.123 的回复: 字节=32 时间=23ms TTL=50
来自 202.141.162.123 的回复: 字节=32 时间=25ms TTL=50
来自 202.141.162.123 的回复: 字节=32 时间=21ms TTL=50

202.141.162.123 的 Ping 统计信息:
    数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
    最短 = 20ms,最长 = 25ms,平均 = 22ms

我用的是校园网。

DigitalOcean的几个CSS某些地区被墙

https://cloud-cdn-digitalocean-com.global.ssl.fastly.net/assets/vnc-d929e45dd2b3056b5ec354b87660f095.js
https://cloud-cdn-digitalocean-com.global.ssl.fastly.net/assets/application-61f840b8fcb709bf93ab378308e7eb06.js
https://cloud-cdn-digitalocean-com.global.ssl.fastly.net/assets/vendor-5708d0dc10309cd4359e0cd03eadbb54.js
https://cloud-cdn-digitalocean-com.global.ssl.fastly.net/assets/application-c67414ba6c81c09460e799069f8b0fdd.css
https://cloud-cdn-digitalocean-com.global.ssl.fastly.net/assets/vendor-b99a94c75b8b259e9b5ffde7b3eaba6a.css
https://cdn.optimizely.com/js/701281621.js

这几个CSS 在有的地方被墙 有的地方却没有

从 RawGit 迁移到其他服务

RawGit 宣布停止服务,并且在首页上推荐了一个可以迁移到 jsDelivr 的链接,建议在此基础上换掉 gooreplacer.gson 里面几个 rawgit.com 的网址。

无法安装

重启chrome后,打开stackoverflow仍然提示:Stack Overflow requires external JavaScript from another domain, which is blocked or failed to load.

force_install_for_windows.reg

这个对应的超链接 点开并没有下载···force_install_for_windows.reg这个注册表啊。
页面内容是这个
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallForcelist]
"1"="paopmncpffekhhffcndhnmjincfplbma;https://github.com/jiacai2050/gooreplacer4chrome/raw/master/updates.xml"

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Chromium\ExtensionInstallForcelist]
"1"="paopmncpffekhhffcndhnmjincfplbma;https://github.com/jiacai2050/gooreplacer4chrome/raw/master/updates.xml"

Could redirect works under the brower's MCB?

windows 8.1 x64
chrome 62.0.3202.75 (JavaScript V8 6.2.414.36)
gooreplacer 2.0
HTTPS Everywhere 2017.10.30

https://www.eff.org/https-everywhere/rulesets

Mixed Content Blocking (MCB)
Some rulesets may trigger active mixed content (i.e. scripts loaded over HTTP instead of HTTPS). This type of mixed content is blocked in both Chrome and Firefox, before HTTPS Everywhere has a chance to rewrite the URLs to an HTTPS version. This generally breaks the site. However, the Tor Browser doesn't block mixed content, in order to allow HTTPS Everywhere to try and rewrite the URLs to an HTTPS version.

比如:
https://bbs.a9vg.com/
会因为MCB导致css等资源全被block, 尽管这些资源几乎都是可以以https访问的. 那么gooreplacer有没有可能实现使得尽管资源被MCB但仍然可以进行后续的https request?

与HTTPS Everywhere冲突

http开头者会被优先重定向到google的https地址。
虽然我这还是穿越了能访问的,但能否做到二次重定向?

chrome 浏览器插件中需要的谷歌字体无法从镜像下载

最近使用google的office在线编辑插件,发现很慢,原来卡在字体上了:
https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic,500,500italic,700,700italic
从网上找到了 gooreplacer 插件,从浏览器地址栏打开上面链接,自动转换很快:
https://fonts.proxy.ustclug.org/css?family=Roboto:400,300,300italic,400italic,500,500italic,700,700italic
但是很遗憾office在线编辑插件中需要获取字体时无法转换。

不能保存数据

操作系统是 win 10
Firefox 版本是 57.0
问题:设置好 Online Rule List, 和 cancel URL 等,重新打开 Firefox 之后,又什么都没有了。

对Request Header Rules的建议

当前版本是【直接】将原来的请求头【清空】后再加上用户自定义的,这样人都癫啊!
应该只是对原来的进行【修改】就够了,或者加个选项让用户自己决定。

规则覆盖

不知道规则有没有应用顺序?比如在线规则有一个 a.com 本地也有一个 a.com 的重定向规则,但是两个的目标地址不一样,插件会以哪个为准?

我想把在线规则里的一个域名 fonts.gstatic.com 给取消(覆盖)掉,就创建了一条本地规则,让 fonts.gstatic.com 指向它自己,在沙盒里测试是 OK 的,但是浏览网页时还是被重定向到在线规则里定义的目标地址了。

image

image

重新开关插件也不行。
版本 3.7

不能在dropbox.com对jquery进行重定向

重定向之后,由于dropbox.com的安全设置,浏览器会拒绝加载jquery。
貌似他们使用了某种黑科技,网页里面加了

<script nonce="Ec6bcxw46VgDO6OXsXQ5">

这段代码的原因
浏览器报错是:

Refused to load the script 'https://ajax.lug.ustc.edu.cn/ajax/libs/jquery/1.10.2/jquery.min.js' because it violates the following Content Security Policy directive: "script-src https://ajax.googleapis.com/ajax/libs/jquery/ 'unsafe-eval' 'self' https://cf.dropboxstatic.com/static/javascript/ https://cf.dropboxstatic.com/static/coffee/compiled/ https://www.dropboxstatic.com/static/javascript/ https://www.dropboxstatic.com/static/coffee/ https://www.google.com/recaptcha/api/ 'unsafe-inline'  'nonce-Ec6bcxw46VgDO6OXsXQ5' ".

gooreplacer chrome版3.3 bug报告

今天在朋友那发现的,回家我的电脑上也有同样问题,应该是bug

导出功能无效,导入正常

迁移命令无效,难道是因为更新了两次把1的给洗白了?

比较蛋疼的是Extensions Manager看是3.3,浏览器扩展管理看是3.4,商店看是3.5。。。妖怪了,我就当是3.3了

无法导入规则

提示 Parse rules error

下载下来本地导入则显示

Uncaught SyntaxError: Unexpected string in JSON at position 435
at JSON.parse ()
at FileReader. (main.js:1369)
(anonymous) @ main.js:1369

规则条数显示错误

  • Gooreplacer v3.6
  • Chrome

一个小问题:在「导入」重复配置时,左下角的总条数显示错误,删除时这个数字两个两个减。

image

可以重定向到本地吗?

类似于local cdn,先下注好资源到本地电脑,然后再重定向,这样速度更快?请问本地规则要怎么样自定义?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.