vocaliu / chrome-redirector

Automatically exported from code.google.com/p/chrome-redirector
GNU General Public License v3.0
0 stars 0 forks source link

为何没有传到chromewebstore #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
实验性api不是已经转正了么?

Original issue reported on code.google.com by rpzrpz...@gmail.com on 9 Jan 2012 at 11:05

GoogleCodeExporter commented 8 years ago
目前正在弄这个事,不过开发者验证这个环节难度比较大,��
�要支持美元支付的信用卡。已试过一张信用卡无效,正在用�
��它方法折腾。。。

Original comment by CyrilF...@gmail.com on 9 Jan 2012 at 12:25

GoogleCodeExporter commented 8 years ago
恩,一定会解决的。

另,能否举点具体范例?对正则不是很会,只能依样画葫芦��
�firefox上的redirector琢磨了好久,一直在找chrome版的,现在找��
�了又不会用……
比方说firefox版有一条是这样写的:

^(https?://)?www\.cnn\.com/(.*)
http://ipv6.cnn.com/$2

Original comment by rpzrpz...@gmail.com on 9 Jan 2012 at 12:57

GoogleCodeExporter commented 8 years ago
一个不是很高效的实现:
Whitelist: /^https?:\/\/www\.cnn\.com.*/
Blacklist: /^https?:\/\/ipv6\.cnn\.com.*/
Substr: /^https?: \/\/www\.cnn\.com(\/.*)/
Replacement: http://ipv6.cnn.com$1
Test URL: http://www.cnn.com/TECH/

这个插件输入正则斜杠`/'需要被转义,将来应该改进;另外��
�Firefox的不大一样,Chrome貌似所有URL都会带上协议,所以不必
有(https?://)?这样的考虑。

Original comment by CyrilF...@gmail.com on 9 Jan 2012 at 1:23

GoogleCodeExporter commented 8 years ago
建议弄个更新的rss……貌似Google code本身就支持?

Original comment by rpzrpz...@gmail.com on 9 Jan 2012 at 1:29

GoogleCodeExporter commented 8 years ago
提示 “死循环”

Original comment by rpzrpz...@gmail.com on 9 Jan 2012 at 1:32

GoogleCodeExporter commented 8 years ago
这些会等到web 
store申请彻底失败后再做。Chrome扩展的更新只需要写个xml文件
就行,Google code确实可以

Original comment by CyrilF...@gmail.com on 9 Jan 2012 at 1:35

GoogleCodeExporter commented 8 years ago
检查一下黑名单?

Original comment by CyrilF...@gmail.com on 9 Jan 2012 at 1:36

GoogleCodeExporter commented 8 years ago
我说的rss是指更新内容,尤其是涉及到这种写法改变的问题��
�…
不明白是啥问题,上图

Original comment by rpzrpz...@gmail.com on 9 Jan 2012 at 1:41

Attachments:

GoogleCodeExporter commented 8 years ago
好吧,我二了,直接按着Firefox那个改了,应该这样:
Whitelist: /^https?:\/\/www\.cnn\.com.*/
Blacklist: /^https?:\/\/ipv6\.cnn\.com.*/
Substr: /^https?:\/\/www\.cnn\.com/
Replacement: http://ipv6.cnn.com
Test URL: http://www.cnn.com/TECH/

在目标中找Substr,然后替换成Replacement中的内容;对于简单的
更改,不涉及捕获的问题。

Original comment by CyrilF...@gmail.com on 9 Jan 2012 at 1:51

GoogleCodeExporter commented 8 years ago
终于成功了,多谢。
开始转换firefox的过来,好多……

下面这句啥意思?
“对于简单的更改,不涉及捕获的问题。”

Original comment by rpzrpz...@gmail.com on 9 Jan 2012 at 2:10

GoogleCodeExporter commented 8 years ago
你给的Firefox那个例子^(https?://)?www\.cnn\.com/(.*)中带括号的就是
捕获,$1指的是https?://匹配的内容,$2指的是.*匹配的内容。
我是考虑到匹配效率的问题,所以把匹配和替换分开来写,��
�样可以简化匹配(白名单);一个副效应是很多捕获也给省�
��一些(当然复杂的时候还是要),替换式也可以相对简单些
。

Comment 10 by rpzrpz123,
> ...
> 下面这句啥意思?
> “对于简单的更改,不涉及捕获的问题。”

Original comment by CyrilF...@gmail.com on 9 Jan 2012 at 2:19

GoogleCodeExporter commented 8 years ago
也就是说下面这个复杂的还是要捕获和匹配?

/^https?:\/\/([^/:@]*)\.(ggpht|googleusercontent)\.com/(.*)/([^/:@]*)/(.*)\.jpg
/^https?:\/\/([^/:@]*)\.(ggpht|googleusercontent)\.com/(.*)/([^/:@]*)/(.*)\.jpg
https://$2.$3.com/$4/s0/$6.jpg

Original comment by rpzrpz...@gmail.com on 9 Jan 2012 at 2:23

GoogleCodeExporter commented 8 years ago
不捕获只能进行一次替换,多处替换一般需要捕获。
不过你这个例子中
/^https?:\/\/([^/:@]*)\.(ggpht|googleusercontent)\.com/(.*)/([^/:@]*)/(.*)\.jpg
只有5个括号,为什么会有$6?

Original comment by CyrilF...@gmail.com on 9 Jan 2012 at 2:31

GoogleCodeExporter commented 8 years ago
错了……是这个:

^(https?://)?([^/:@]*)\.(ggpht|googleusercontent)\.com/(.*)/([^/:@]*)/(.*)\.jpg
^(https?://)?([^/:@]*)\.(ggpht|googleusercontent)\.com/(.*)/([^/:@]*)/(.*)\.jpg
https://$2.$3.com/$4/s0/$6.jpg

刚在改,替换了……

Original comment by rpzrpz...@gmail.com on 9 Jan 2012 at 2:33

GoogleCodeExporter commented 8 years ago
已经进入CWS,关闭此issue。

Original comment by CyrilF...@gmail.com on 27 Feb 2012 at 4:17