Violentmonkey: JQuery-UI causes an error in 2.12.8

Created on 17 Dec 2020  路  5Comments  路  Source: violentmonkey/violentmonkey

What is the problem?

If the jquery-ui library is specified in a script's @require block, the script crashes with an error in Chrome.
Note that this was not the case in version 2.12.7. This also does not happen if this library is used outside of a userscript, nor is it present in the Firefox version.

Here is a sample script, used to reliably reproduce this issue:

// ==UserScript==
// @name        JQuery-UI Test
// @namespace   test.jquery-ui
// @version     1.0
// @match       *://*/*
// @require     https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js
// @require     https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js
// @grant       GM.info
// ==/UserScript==

console.log(GM.info);

How to reproduce it?

  1. Run the script above
  2. Observe the error in the console

What is the expected result?

The script runs normally.

What is the actual result?

The following error is produced:

JQuery-UI Test.user.js:28 RangeError: Maximum call stack size exceeded
    at Set.V (injected-web.js:1)
    at Array.filter (<anonymous>)
    at Object.ownKeys (injected-web.js:1)
    at Function.t.widget.extend (JQuery-UI Test.user.js:9)
    at Function.t.widget.extend (JQuery-UI Test.user.js:9)
    at Function.t.widget.extend (JQuery-UI Test.user.js:9)
    at Function.t.widget.extend (JQuery-UI Test.user.js:9)
    at Function.t.widget.extend (JQuery-UI Test.user.js:9)
    at Function.t.widget.extend (JQuery-UI Test.user.js:9)
    at Function.t.widget.extend (JQuery-UI Test.user.js:9)

Environment

  • Browser: Google Chrome
  • Browser version: 87.0.4280.88 (latest)
  • Violentmonkey version: 2.12.8
  • OS: Windows

All 5 comments

This is the same problem we've fixed for Firefox in #861. Apparently Chrome changed its behavior so we'll apply the fix for Chrome too.

@gera2ld :sigh: this probably warrants an early new release...

Thank you!

Will the 2.12.9 update be pushed to the chrome web store anytime soon? In the meantime, I've resorted to switching to TamperMonkey for the scripts broken by this bug. I'd prefer not to use TamperMonkey at all.

The stores are slow. Meanwhile you can install the new release as an unpacked extension in dev mode. When the store is updated you can remove the extension and reinstall it from the store. Don't forget to back up your data.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rayman89 picture rayman89  路  4Comments

ale82to picture ale82to  路  6Comments

ivysrono picture ivysrono  路  4Comments

Mehavoid picture Mehavoid  路  3Comments

CrendKing picture CrendKing  路  4Comments