Skip to content

Firefox fingerprinting protection breaks mouse event handling #1087

@eternal-sorrow

Description

@eternal-sorrow

I noticed some years ago that some html5 games do not work correctly in my browser. The problem is always the same - a click at any point in the canvas always registers as a click at one specific element on the screen. I couldn't pinpoint the issue correctly so I didn't know where to ask help for this, so I just shrugged back then, started Chrome and the game worked as expected in it. Recently I decided to investigate and after a debug session I found that the game in question uses CreateJS and soon I found the culprit:

var hit = ctx.getImageData(0, 0, 1, 1).data[3] > 1;

CreateJS uses getImageData canvas method to detect a hit on an element. With fingerprinting protection enabled this method returns random noise on Firefox. So CreateJS always detects a hit on the first displayed object, no matter where the click actually happened.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions