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

event fired on readystatechange doesn't contain currentTarget #112

Open
ejrcavenago opened this issue Jun 4, 2020 · 4 comments
Open

event fired on readystatechange doesn't contain currentTarget #112

ejrcavenago opened this issue Jun 4, 2020 · 4 comments

Comments

@ejrcavenago
Copy link

Hi!

I have a case of conflicting library. I've used xdomain for a long time, but now I'm trying to use hls.js to reproduce videos using HTTP Live Streaming.

Hls.js rely on event.currentTarget to retrieve the xhr object and continue with the code, but it seems that xhook strip that off merging with the result of fakeEvent on firing events.

@zaide-chris
Copy link

In the final js changing

    try {
      dst[k] = src[k];
    } catch (_error) {
    }

to

    try {
      dst[k] = v;
      if(dst[k] !== v){
        Object.defineProperty(dst, k, {writable: false, value: v})
      }
    } catch (_error) {
    }

and both of the facade[FIRE]("readystatechange", {}); lines
to facade[FIRE]("readystatechange", {currentTarget: facade});
Fixes this issue.

@holly-hacker
Copy link

holly-hacker commented Jul 8, 2022

@jpillora could this be incorporated in a new release of xhook? This issue is a blocker for me and the suggested patch fixed it.

@holly-hacker
Copy link

Seems like duplicate of #96

@jpillora
Copy link
Owner

jpillora commented Jul 9, 2022

#108 will land soon, and then any/all fixes should go in the new ES6 code base

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

4 participants