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

Doesn't work with Chrome 78 (most of the time) #152

Open
turt2live opened this issue Nov 12, 2019 · 1 comment
Open

Doesn't work with Chrome 78 (most of the time) #152

turt2live opened this issue Nov 12, 2019 · 1 comment

Comments

@turt2live
Copy link

The first badge update goes through fine, but then updates are only applied when the user is looking at the page. This seems to be a Chrome change because it works fine in earlier versions of Chrome, but the fix for the time being is to trigger the update twice.

@stekie
Copy link

stekie commented Dec 30, 2019

The canvas context which receives the draw calls doesn't update the canvas display immediately in new chrome versions when the page is not visible.
It is however updated after the next tick in the event loop. You, therefore, can change the "link.setIcon" function in the source code to:

link.setIcon = function (canvas) {
setTimeout(function() {
var url = canvas.toDataURL('image/png');
link.setIconSrc(url);
}, 0);
};

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

2 participants