Skip to content

Conversation

@ronalduQualabs
Copy link

Description

remove global and use 'videojs-global-compat' to fix videojs/video.js#9103

If it's a feature or enhancement please be as detailed as possible.
If it's a bug fix, please link the issue that it fixes or describe the bug in as much detail.

Specific Changes proposed

Please list the specific changes involved in this pull request.

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
  • Reviewed by Two Core Contributors

@welcome
Copy link

welcome bot commented Nov 5, 2025

💖 Thanks for opening this pull request! 💖

Things that will help get your PR across the finish line:

  • Run npm run lint -- --errors locally to catch formatting errors earlier.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

Copy link
Contributor

@mister-ben mister-ben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package.json Outdated
"mux.js": "7.1.0",
"video.js": "^7 || ^8"
"video.js": "^7 || ^8",
"videojs-global-compat": "^1.0.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repo and package probably ought to be in the video.js GitHub and NPM orgs.

assert.equal(beforeLocalRequestCalled, 2, 'local beforeRequest was called twice ' +
'for the media playlist and media');
assert.equal(beforeGlobalRequestCalled, 1, 'global beforeRequest was called once ' +
assert.equal(beforeGlobalRequestCalled, 1, 'videojs-global-compat beforeRequest was called once ' +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert.equal(beforeGlobalRequestCalled, 1, 'videojs-global-compat beforeRequest was called once ' +
assert.equal(beforeGlobalRequestCalled, 1, 'global beforeRequest was called once ' +


assert.equal(onRequestHookCallCountGlobal, 0, 'no onRequest global hooks called');
assert.equal(actualRequestUrlGlobal, undefined, 'global request url undefined');
assert.equal(actualRequestUrlGlobal, undefined, 'videojs-global-compat request url undefined');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert.equal(actualRequestUrlGlobal, undefined, 'videojs-global-compat request url undefined');
assert.equal(actualRequestUrlGlobal, undefined, 'globalrequest url undefined');

test/xhr.test.js Outdated

this.xhr(defaultOptions);
assert.equal(this.requests.shift().url, 'global', 'url changed with global override');
assert.equal(this.requests.shift().url, 'videojs-global-compat', 'url changed with global override');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert.equal(this.requests.shift().url, 'videojs-global-compat', 'url changed with global override');
assert.equal(this.requests.shift().url, 'global', 'url changed with global override');

test/xhr.test.js Outdated

videojs.Vhs.xhr.beforeRequest = () => {
return { uri: 'global-newOptions'};
return { uri: 'videojs-global-compat-newOptions'};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return { uri: 'videojs-global-compat-newOptions'};
return { uri: 'global-newOptions'};

test/xhr.test.js Outdated

this.xhr(defaultOptions);
assert.equal(this.requests.shift().url, 'global-newOptions', 'url changed with global override');
assert.equal(this.requests.shift().url, 'videojs-global-compat-newOptions', 'url changed with global override');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert.equal(this.requests.shift().url, 'videojs-global-compat-newOptions', 'url changed with global override');
assert.equal(this.requests.shift().url, 'global-newOptions', 'url changed with global override');

test/xhr.test.js Outdated
xhrRequest = this.requests.shift();

assert.equal(xhrRequest.url, 'global', 'url changed with global onRequest hooks');
assert.equal(xhrRequest.url, 'videojs-global-compat', 'url changed with global onRequest hooks');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert.equal(xhrRequest.url, 'videojs-global-compat', 'url changed with global onRequest hooks');
assert.equal(xhrRequest.url, 'global', 'url changed with global onRequest hooks');

test/xhr.test.js Outdated
this.xhr(defaultOptions);
xhrRequest = this.requests.shift();
assert.equal(xhrRequest.url, 'global', 'url changed with player onRequest hooks');
assert.equal(xhrRequest.url, 'videojs-global-compat', 'url changed with player onRequest hooks');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert.equal(xhrRequest.url, 'videojs-global-compat', 'url changed with player onRequest hooks');
assert.equal(xhrRequest.url, 'global', 'url changed with player onRequest hooks');

test/xhr.test.js Outdated
assert.equal(response.headers.foo, 'bar', 'expected headers');
assert.equal(response.statusCode, 200, 'expected statusCode');
assert.equal(globalHookCallCount, 0, 'global response hooks not called yet');
assert.equal(globalHookCallCount, 0, 'videojs-global-compat response hooks not called yet');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert.equal(globalHookCallCount, 0, 'videojs-global-compat response hooks not called yet');
assert.equal(globalHookCallCount, 0, 'globalresponse hooks not called yet');

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.02%. Comparing base (bd810ea) to head (6cee06f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1595      +/-   ##
==========================================
+ Coverage   84.00%   84.02%   +0.01%     
==========================================
  Files          44       44              
  Lines       11710    11710              
  Branches     2625     2625              
==========================================
+ Hits         9837     9839       +2     
+ Misses       1873     1871       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Successfully merging this pull request may close these issues.

min-document vulnerable to prototype pollution

2 participants