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.02k stars 412 forks source link

The cookie value is invaild with GM_xmlhttpRequest after upgrade to v5.2.0 #2112

Open Tinyfatboy opened 4 days ago

Tinyfatboy commented 4 days ago

Actual Behavior

Hello, after upgrading to Tampermonkey 5.2.0, the original script failed when sending requests using GM_xmlhttpRequest. We compared all the API information of version 5.1.1 and found that after the upgrade, if the cookie value contains quotation marks ", the GM_xmlhttpRequest method will encode the quotation marks to %22, causing the original script to fail.

eg. original cookie (v5.1.1) idtt.certInfo="W7I356...

with v5.2.0 idtt.certInfo=22%W7I356...

This affect our script and makes GM_xmlhttpRequest failed. Cloud you help to check.

Specifications

Script

// ==UserScript==
// @name         myScript
// @namespace    http://tampermonkey.net/
// @author       myName
// @match        https://example.com
// @run-at       document-start
// @grant        GM_xmlhttpRequest
// @connect      target.example.com
// ==/UserScript==

(function() {
    GM_xmlhttpRequest({
        url: 'https://target.example.com,
    });
})();
derjanb commented 3 days ago

Can you please test Tampermonkey BETA. Thanks.

Tinyfatboy commented 3 days ago

Can you please test Tampermonkey BETA. Thanks.

Hello, thanks for your advice. I tested with Tampermonkey BETA, but the error still occurs.

derjanb commented 3 days ago

Thanks a lot. Please use Tampermonkey Legacy as long as I'm working on a fix...