Tampermonkey / tampermonkey

Tampermonkey is the most popular userscript manager, with over 10 million users. It's available for Chrome, Microsoft Edge, Safari, Opera Next, and Firefox.
GNU General Public License v3.0
4.3k stars 424 forks source link

Possible mishandling of Ajax hooks causes page to break #245

Closed kellyelton closed 8 years ago

kellyelton commented 9 years ago

Here is a page that's a good example of what I'm talking about

http://leafletjs.com/examples/quick-start.html

if you make a tampermonkey script like this

// ==UserScript==
// @name         Ajax Test
// @namespace    http://leafletjs.com/examples/
// @version      0.1
// @description  enter something useful
// @author       You
// @match        http://leafletjs.com/examples/*
// @grant        none
// ==/UserScript==

If you go to that page and start scrolling and zooming and scolling and zooming randomly, after about 30 seconds the map stops rendering tiles. If you check the network tab you'll see that all the requests for images are pending. If you refresh the page, the requests still fail. The only fix is to open the page in a new window.

The backend doesn't matter, as I have my own implementation of leaflet.js on a different server and the same thing happens.

Also when I disable tampermonkey, or don't target that page, the problem arises.

derjanb commented 9 years ago

Can not reproduce this at Ubuntu at all. Tested with: Version 48.0.2547.0 dev (64-bit) Version 45.0.2454.101 Ubuntu 14.04

But I can reproduce this at Windows with: Version 46.0.2490.71 m

However I can reproduce this even without Tampermonkey but User-Agent Switcher installed. It just takes a little longer. So this is not caused but triggered by Tampermonkey.

[1] https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg/related

kellyelton commented 9 years ago

I don't have user agent switcher installed.

derjanb commented 9 years ago

I'm just saying I can reproduce this without having TM installed. So it's nothing that is caused by TM.

kellyelton commented 9 years ago

I don't think that really makes sense. TM causes the problem, so does User Agent Switcher...just because it happens also with another extension doesn't mean your extension doesn't cause it.

It seems obvious that both plugins are causing the problem, independently, most likely due to the hooking of ajax calls.

derjanb commented 9 years ago

I'm not able to reproduce this at Windows with Version 48.0.2553.1 canary.

TM causes the problem

There is a difference between "cause" and "trigger". If Chrome's API has a problem and both extension use it, they do not cause the problem, but they trigger it.

Unfortunately the log doesn't show anything suspicious, neither do the information from chrome://net-internals.