-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
extension: expose URL shim #5293
Conversation
lighthouse-extension/gulpfile.js
Outdated
// browerify's url shim doesn't work with .URL in node_modules, so expose our own | ||
// @see https://github.com/GoogleChrome/lighthouse/issues/5273 | ||
const pathToURLShim = require.resolve('../lighthouse-core/lib/url-shim.js'); | ||
bundle = bundle.require(pathToURLShim, {expose: 'url'}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this lowercase usage of it used? i'm not following what the fix is here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inside robots-parser it does var URL = require('url').URL
@@ -132,6 +132,7 @@ class URLShim extends URL { | |||
} | |||
} | |||
|
|||
URLShim.URL = URL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
who uses URL.URL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
robots parser, see above :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, this definitely only adds to the url-shim browserify confusion but I can't think of a better solution so LGTM :)
we do expose ourselves to some possible future bugs if we end up using a module that uses require('url').parse()
or whatever, but there's not a great solution available and hopefully everyone will be using the global URL
soon enough...
Related Issues/PRs
fixes #5273