chenzhekl / unblock-youku-firefox

Firefox port of the chrome extension Unblock Youku.
https://addons.mozilla.org/en-US/firefox/addon/unblock-youku-firefox/
GNU Affero General Public License v3.0
31 stars 5 forks source link

Have problems visiting Youku with Firefox add-on while fine with Chrome extension #6

Closed guyigenius closed 6 years ago

guyigenius commented 7 years ago

My Firefox version is 56.0.2 (64-bit). Link like this http://v.youku.com/v_show/id_XMzk1NjM1MjAw.html can be visited with Chrome extension but seems to have problems with Firefox extension. Firefox extension worked all fine last week, so I guess something changed this week caused this problem?

chenzhekl commented 7 years ago

Thanks for the feedback. I'll look into it tonight.

chenzhekl commented 7 years ago

Hi @guyigenius ,

Have you visited http://v.youku.com/v_show/id_XMzk1NjM1MjAw.html before the upgrade? I just added two lines to the database in the new version, that should not change the baviours of Youku. Besides, the android version works correctly, which is quite weird...

guyigenius commented 7 years ago

@chenzhekl I visited it successfully several days ago but not sure if there was an upgrade. I still cannot visit it currently on Windows or macOS. BTW, this extension cannot switch mode on Linux. can switch mode after I upgrade Firefox but still cannot visit.

chenzhekl commented 7 years ago

I finally realized it's a bug of Firefox. Since Firefox doesn't provide the full path for proxy matching, the plugin is unable to find out wheter to use a proxy server for rules requiring full path (e.g. "http://v.youku.com/v_show/*"). There's nothing I can do but waiting for upstream fixes.

guyigenius commented 7 years ago

@chenzhekl I see but this bug existed long time ago why I could visit the link several days ago with no upgrade still 56.0.2?

chenzhekl commented 7 years ago

My guess is that you upgraded the browser recently which introduced this bug.

I am not sure how long the bug has existed, and if it was fixed then reintroduced in the middle. Let's hope it could be fixed soon.

On Nov 13, 2017 01:10, "guyigenius" notifications@github.com wrote:

@chenzhekl https://github.com/chenzhekl I see but this bug existed long time ago why I could visit the link several days ago with no upgrade still 56.0.2?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chenzhekl/unblock-youku-firefox/issues/6#issuecomment-343747751, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJTn_MHAura-QL9RLhPRj4CrcNVdsi_ks5s1xiKgaJpZM4Qalr6 .

guyigenius commented 7 years ago

@chenzhekl That's so weird because the latest version 56.0.2 was first offered to Release channel users on October 26, 2017, I'm sure I visited the link successfully with 56.0.2 several days ago. Also I tried previous versions like 56.0 and 56.0.1 (this extension cannot switch mode under 56.0 like 55.0.x), neither worked.😂

chenzhekl commented 7 years ago

I tested http://v.youku.com/v_show/id_XMzk1NjM1MjAw.html with each previous version of Unblock Youku Firefox on Firefox 57. Here's the result:

Version Working?
0.1.0 No
0.1.1 No
0.1.2 No
0.1.3 No
0.1.4 No

In a word, It's the problem of Firefox. I am busy in preparing my master's thesis right now. If interested, you can contribute a patch to Firefox. I believe everyone will be happy for that.

placetne commented 7 years ago

@guyigenius I created a fork of the original Unblock Youku for Firefox at https://github.com/placetne/Unblock-Youku-Firefox/ . This is a non-Web Extension Firefox add on. So it won't work for Firefox 57, but it does work for Firefox 56. The only file I updated was the file with the list of URLs it uses for the proxy, but changing that was good enough to make it work for the all of the sites I've used in the past. You also might have to set (in about:config) network.proxy.autoconfig_url.include_path to true.

Since this isn't a signed Add-On, you would have to upload it through about:debugger

guyigenius commented 7 years ago

@placetne Thank you for your advice. I know whuhacker's Unblock Youku Firefox extension (https://github.com/whuhacker/Unblock-Youku-Firefox) works fine by updating /lib/urls.js with Unblock-Youku Chrome extension (https://github.com/uku/Unblock-Youku/blob/master/shared/urls.js) in about:debugging, however, this is not a permanent solution for me because I prefer not to stay with old versions. And whuhacker's extension is based on the Add-on SDK, some APIs are not provided by WebExtension so not easy to port it to WebExtension.

guyigenius commented 7 years ago

@chenzhekl Thank you for your patience. Though I still cannot understand why I could visit Youku before, I believe this is because of that bug. I hope Firefox would develop more WebExtension APIs on browser.proxy. And I wish you all the best with your master's thesis.

chenzhekl commented 6 years ago

Would fix this once 1409878 is resolved.

guyigenius commented 6 years ago

@chenzhekl Thank you for your follow-up on this issue. The async proxy api for webextensions will be implemented in Firefox 60, hope this issue would be fixed soon😃.

guyigenius commented 6 years ago

@chenzhekl The proxy API docs have been updated, is it possible to fix this bug now? Thank you very much.

chenzhekl commented 6 years ago

I have created a new branch called firefox60, which includes needed fixes. But I haven’t thoroughly tested it. Give it a try if you are interested.

Looking forward to your feedback! :)

guyigenius notifications@github.com于2018年5月5日 周六下午6:20写道:

@chenzhekl https://github.com/chenzhekl The proxy API docs have been updated, is it possible to fix this bug now? Thank you very much.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/chenzhekl/unblock-youku-firefox/issues/6#issuecomment-386792222, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJTn1Phx-SDj-_uGEOm-QhLUAA7JY42ks5tvW7KgaJpZM4Qalr6 .

guyigenius commented 6 years ago

@chenzhekl Yeah I saw it and tried version 0.2.4. on Firefox 61.0b2, but unfortunately I didn't feel many differences between 61.0b2 and 59.0.3, link like http://v.youku.com/v_show/id_XMjUyNjM5ODg2NA==.html cannot be visited on both 61.0b2 and 59.0.3 while fine with Chrome extension.

Link like http://v.youku.com/v_show/id_XMzk1NjM1MjAw.html which I tested to report this bug can now be visited on both 61.0b2 and 59.0.3, but actually it has nothing to do with this extension, I can still visit the link without the extension, this is so weird! Maybe this was the same situation when I reported this bug (Firefox extension worked all fine last week...)?

BTW, congratulations on your Master graduation and good luck for your Ph.D.!

placetne commented 6 years ago

Hi. I got the same problem as @guyigenius . I did some research, and I found out 3 things.

1) It turns out Mozilla has introduced a new Proxy API in Firefox 60. You can access the full path only if you use the new Proxy API. The new API is here:

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/proxy/onRequest

It replaces the proxy.register with proxy.onRequest

2) Also, proxy.onProxyError has been deprecated and replaced by proxy.onError

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/proxy/onError

3) And you would also have add a new permission for the add on to work: ""

chenzhekl commented 6 years ago

@guyigenius @placetne Thanks for your feedback! Did you try the code from firefox60 branch? The 0.2.4 version didn't include the fixes I mentioned.

guyigenius commented 6 years ago

@chenzhekl Yeah, I tested from firefox60 branch. On 59.0.3 link http://v.youku.com/v_show/id_XMjUyNjM5ODg2NA==.html will redirect to http://www.youku.com/index/y404/ while on 61.0b2 it won't redirect but shows "抱歉,该视频仅限中国大陆地区播放,请您观看其他视频!", both cannot be visited so not many differences actually.

chenzhekl commented 6 years ago

@guyigenius Thanks! I will look into it tonight.

guyigenius commented 6 years ago

@chenzhekl BTW, There might be some problems in the icon when switching mode.

chenzhekl commented 6 years ago

@guyigenius Not sure how the add-on was loaded, it worked for me. I will upload a new version tagged 3.0 today. Could you help give it a try?

2018-05-08 11 12 06
guyigenius commented 6 years ago

@chenzhekl I think I might test firefox60 branch in the wrong way, would you please specify how you build firefox60 branch and load it in Firefox Developer Edition?

chenzhekl commented 6 years ago

@guyigenius

  1. Clone the repo.
git clone https://github.com/chenzhekl/unblock-youku-firefox.git
  1. Checkout the firefox60 branch.
git checkout firefox60
  1. Install dependencies.
yarn
  1. Build the add-on.
yarn run build
  1. Load the add-on from Firefox.
guyigenius commented 6 years ago

@chenzhekl Thank you very much. I have tested firefox60 branch following your instructions and it works perfect now. The reason I failed the tests is that I didn't notice my build was failed before I loaded it from Firefox(some error with webpack). I should double check bugs before I report them, sorry about that.

chenzhekl commented 6 years ago

Uploaded version 0.3.0

guyigenius commented 6 years ago

@chenzhekl I think this issue could be closed now and the README could be updated as well. BTW, Is there still any conflict with uBlock Origin (listed in the README)?

chenzhekl commented 6 years ago

No, it has been resolved as well. I will update the README.

Many thanks to you.

guyigenius notifications@github.com于2018年5月10日 周四上午9:40写道:

@chenzhekl https://github.com/chenzhekl I think this issue could be closed now and the README could be updated as well. BTW, Is there still any conflict with uBlock Origin (listed in the README)?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/chenzhekl/unblock-youku-firefox/issues/6#issuecomment-387916254, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJTny1gZ425FWwgphqRh5BiwzBMeg0yks5tw4yBgaJpZM4Qalr6 .

guyigenius commented 6 years ago

@chenzhekl Highly appreciate your quick response all the time and good luck for your Ph.D.!