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

window.devicePixelRatio fails in Firefox and Chrome 57 #81

Closed
Knagis opened this issue Mar 2, 2017 · 4 comments
Closed

window.devicePixelRatio fails in Firefox and Chrome 57 #81

Knagis opened this issue Mar 2, 2017 · 4 comments

Comments

@Knagis
Copy link

Knagis commented Mar 2, 2017

Reading the value of window.devicePixelRatio throws an error in Firefox:

TypeError: 'get devicePixelRatio' called on an object that does not implement interface Window.

It seems this might be caused by the same issue as was reported in #38

    export class Visual implements IVisual {
        constructor(options: VisualConstructorOptions) {
            console.log("devicePixelRatio test");
            try {
                console.log("devicePixelRatio ok", window.devicePixelRatio);
            } catch (e) {
                console.error("devicePixelRatio err", e);
            }
        }
    }

The same code works correctly on Chrome.

@Knagis
Copy link
Author

Knagis commented Mar 20, 2017

This also happens now on Chrome 57.

@Knagis Knagis changed the title window.devicePixelRatio fails in Firefox window.devicePixelRatio fails in Firefox and Chrome 57 Mar 20, 2017
@Trottsie
Copy link

Trottsie commented Apr 5, 2017

Same issue here chrome 57 not working. This is having a significant impact.

@ghynes
Copy link

ghynes commented Apr 13, 2017

Any updates on this? It's a huge issue for us at the moment, breaking critical visualizations

@ignatvilesov
Copy link
Contributor

ignatvilesov commented Apr 14, 2017

The current workaround is to use window.window.devicePixelRatio instead.

Please note we've created the common issue to track current status.

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

No branches or pull requests

5 participants