Skip to content
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

Renamed self to window since we're in a browser environment and want to support jsdom/jsdomify #239

Closed
wants to merge 1 commit into from

Conversation

niftylettuce
Copy link

Closes #238

@niftylettuce niftylettuce changed the title 🐛 Renamed self to window since we're in a browser environment and want to support jsdom/jsdomify Renamed self to window since we're in a browser environment and want to support jsdom/jsdomify Nov 29, 2015
@niftylettuce
Copy link
Author

Looks like tests fail because of iframes or something?

Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL

@mislav
Copy link
Contributor

mislav commented Nov 30, 2015

Sorry, but self was used to enable this polyfill working in a web worker environment.

We're sorry that you're having problems with jsdom/jsdomify, but we can't help you with that. Our polyfill works quite fine when loaded normally onto the page with <script src> tags. If your tools can't handle normal js files, maybe it's time to revisit your tools?

@mislav mislav closed this Nov 30, 2015
@mislav
Copy link
Contributor

mislav commented Nov 30, 2015

Also see #231 #47 #31

@niftylettuce
Copy link
Author

Is there not a way you can ensure a fallback instead of self? Why can't you? This doesn't seem right. Otherwise I have to rely on my fork to get my tests to pass for https://github.com/niftylettuce/frisbee.

@niftylettuce
Copy link
Author

if (typeof window === 'object') self = window;?

@niftylettuce
Copy link
Author

It really doesn't make sense to me to use self JUST to make your tests pass. That's not right.

@niftylettuce
Copy link
Author

@mislav yeah I have to stop using jsdomify and run it per jsdom/jsdom#1203 (comment) and just use pure jsdom with proper window environment.

@niftylettuce
Copy link
Author

ignore this PR.

@mislav
Copy link
Contributor

mislav commented Nov 30, 2015

Is there not a way you can ensure a fallback instead of self? Why can't you? This doesn't seem right.

We welcome a PR that solves the compatibility issue you're describing in an elegant way while at the same time preserving compatibility with Web Workers. The existing CI test suite must pass.

@mislav mislav mentioned this pull request Jan 5, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rename self to window
2 participants