hulk-yin opened a new issue, #13395:
URL: https://github.com/apache/skywalking/issues/13395

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Apache SkyWalking Component
   
   OAP server (apache/skywalking)
   
   ### What happened
   
   Description: After initializing SkyWalking (client-js), the current 
interception logic replaces window.XMLHttpRequest with a function, not a class. 
This breaks the prototype chain, so other modules that patch or instrument 
XMLHttpRequest via its prototype will fail. They can't access or extend the 
prototype anymore.
   
   Related Code: (window as any).XMLHttpRequest = customizedXHR in 
skywalking-client-js/src/trace/interceptors/xhr.ts.
   
    
   
   ### What you expected to happen
   
   
   Expected Behavior: SkyWalking should preserve the prototype chain (e.g., by 
wrapping or subclassing XMLHttpRequest), allowing other modules to patch it as 
usual.
   
   
   ### How to reproduce
   
   
   Initialize SkyWalking.
   Try to patch XMLHttpRequest.prototype in another module.
   Patching fails.
   
   
   ### Anything else
   
   Suggestion: Consider alternative interception strategies to preserve 
prototype functionality.
   
   ### Are you willing to submit a pull request to fix on your own?
   
   - [x] Yes I am willing to submit a pull request on my own!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
notifications-unsubscr...@skywalking.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to