Git Product home page Git Product logo

Comments (4)

jiangts avatar jiangts commented on September 26, 2024

I submitted a patch for the particular issue I was facing in #69, but am still curious re the design.

from xhook.

jpillora avatar jpillora commented on September 26, 2024

Hi @jiangts by using a facade version of XMLHttpRequest, we can intercept everything and modify anything. A brief glance at ajax-interceptor tells me that it creates a global readystatechange event handler and not much else...

Thanks for the PR! Any and all fixes to non-adherence to the spec are greatly appreciated :)

from xhook.

jiangts avatar jiangts commented on September 26, 2024

Right -- ajax-interceptor also seems to only override 1 method on the original XMLHttpRequest object at a time. Obviously, there are tradeoffs, but this seems like a wise approach in order to ensure the API to the "tainted" XMLHttpRequest object continues to be consistent.

I spent a couple hours debugging some weird code with req.responseType = 'arraybuffer' last night to no avail -- xhook was still returning the response as a string rather than arraybuffer type.

from xhook.

jpillora avatar jpillora commented on September 26, 2024

That's strange, responseType should just be set on the underlying XHR object... It'd be great if you could make a simple HTML page demonstrating the issue and post a link to it on new issue. Closed with #69.

from xhook.

Related Issues (20)

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.