RDKEMW-22317 : Integrate VIPA widget 1.4.4.5 with nativescript - #138
RDKEMW-22317 : Integrate VIPA widget 1.4.4.5 with nativescript#138gurpreet319 wants to merge 1 commit into
Conversation
Reason for change: Integrate VIPA 1.4.4.5 with nativescript, updated the xhr and URLSearchParams. Test Procedure: build should be successful Risk: low Priority: P2
There was a problem hiding this comment.
Pull request overview
This PR updates the JS runtime networking utilities to support integrating VIPA widget v1.4.4.5 with NativeScript, focusing on improving XMLHttpRequest behavior and expanding URLSearchParams compatibility.
Changes:
- Refactors
XMLHttpRequest.open()/send()to reset internal state more safely, parse URLs via the WHATWGURLAPI, and harden request/redirect handling. - Updates auth header creation to use
Buffer.fromand improves event dispatching to pass an event object to handlers/listeners. - Extends
URLSearchParamsconstruction to accept additional init shapes and adds iteration APIs (forEach,entries,keys,values).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| utils/xhr.js | XHR state reset, URL parsing + request option construction, redirect handling, transport validation, and event dispatch behavior updates. |
| src/jsc/modules/lib/URLSearchParams.js | Broader constructor input support and added iteration/utility methods (forEach/entries/keys/values). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| request.on("error", errorHandler); | ||
| if (typeof request.on === "function") { | ||
| request.on("abort", function() { | ||
| self.handleError(new Error("XMLHttpRequest: request aborted by transport")); | ||
| }); | ||
| } |
| if (typeof self["on" + event] === "function") { | ||
| self["on" + event](); | ||
| self["on" + event](evt); | ||
| } |
| try { | ||
| var parsedUrl = new URL(urlToUse); | ||
| switch (parsedUrl.protocol) { | ||
| case "https:": | ||
| ssl = true; |
|
b'## WARNING: A Blackduck scan failure has been waived A prior failure has been upvoted
|
| * | ||
| * @author Dan DeFelippi <dan@driverdan.com> | ||
| * @contributor David Ellis <d.f.ellis@ieee.org> | ||
| * @license MIT |
There was a problem hiding this comment.
If you have significantly changed the original DeFelippi code, it would be good to add a comment here to say something like:
"Some modifications by Comcast".
It is not strictly required by the license but nice to acknowledge.
Reason for change: Integrate VIPA 1.4.4.5 with nativescript, updated the xhr and URLSearchParams.
Test Procedure: build should be successful
Risk: low
Priority: P2