Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] Conflict with uBlock Origin #127

Closed
cyfung1031 opened this issue Sep 2, 2023 · 4 comments
Closed

[Bug Report] Conflict with uBlock Origin #127

cyfung1031 opened this issue Sep 2, 2023 · 4 comments

Comments

@cyfung1031
Copy link
Contributor

cyfung1031 commented Sep 2, 2023

If uBlock Origin is enabled, YouTube will be frozen due to the conflict with ajax-hook.

Reproduction:

  1. Use Chrome (or Firefox)
  2. Install uBlock Origin (v1.51.0)
  3. Install Userscript Manager Tampermonkey or Violentmonkey
Screen Shot 2023-09-02 at 19 22 08
  1. create a new userscript to let the code inject at the very first begining.
// ==UserScript==
// @name        Testing 333
// @namespace   TestScripts
// @match       https://www.youtube.com/*
// @grant       none
// @version     1.0
// @author      abc
// @description Testing
// @require     https://github.com/wendux/ajax-hook/raw/master/dist/ajaxhook.js
// @run-at      document-start
// ==/UserScript==

ah.proxy({
    onRequest: (config, handler) => {
        handler.next(config);
    },
    onResponse: (response, handler) => {
        handler.resolve(response);
    }
});
  1. open youtube.com
  2. frozen

Screenshots

Chrome:

Screen Shot 2023-09-02 at 19 21 36

Firefox:

Screen Shot 2023-09-02 at 19 23 47

Console Error:

Chrome:
Screen Shot 2023-09-02 at 19 25 14

Firefox:
Screen Shot 2023-09-02 at 19 24 56

Remarks 1:

Tried to downgrade to earlier version like
Jun 14, 2022 9efea44
https://github.com/wendux/ajax-hook/raw/9efea44c8b2bc27b5ec0e8c2e3a2477bdc76dab9/dist/ajaxhook.js

Same result.

Remarks 2:

If PR #120 is applied, the issue might get resolved by bypassing the urls.

@cyfung1031 cyfung1031 changed the title Conflict with uBlock Origin [Bug Report] Conflict with uBlock Origin Sep 2, 2023
@DAHUIAAAAA
Copy link
Collaborator

bypass 的问题不着急过,先看看是什么原因导致的,是哪些原因导致的冲突,再从问题下手,onConfig 的方式虽然说可以饶过一整条链路,但是这个配置项一眼过去比较难理解是用来干什么的

cyfung1031 added a commit to cyfung1031/userscript-supports that referenced this issue Sep 3, 2023
@cyfung1031
Copy link
Contributor Author

bypass 的问题不着急过,先看看是什么原因导致的,是哪些原因导致的冲突,再从问题下手,onConfig 的方式虽然说可以饶过一整条链路,但是这个配置项一眼过去比较难理解是用来干什么的

對,那個不用緊
這個衝突可能需要把整個底層重寫

剛試寫了一下,如果是用Inherit Class 的方法寫getter的話,是可以做到相同效果又不會出現衝突。
https://github.com/culefa/xhProxy/blob/main/dist/xhProxy.js
示範:https://greasyfork.org/en/scripts/473130-ytdls-youtube-dual-language-subtitle-modified

@DAHUIAAAAA
Copy link
Collaborator

看起来不错,可以试试~ 不过是什么原因呢?

@cyfung1031
Copy link
Contributor Author

我在Chrome和Firefox試了一下
只把Lists更新或者是Purge或者是取消uBlock filters - ads也是沒用的
把uBO裡面的Built-in lists 把uBlock filters - Quick fixes 取消打勾,套用,再打勾再套用,就沒事了
之後即使把uBO的設定初始化,或是reinstall也是沒事的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants