admin管理员组

文章数量:1396778

I have a small problem, I have a script (I'm using Tampermonkey) and when I make a POST request, it says:

VM2584:33 Refused to connect to "/": URL is not a part of the @connect list

The thing that it IS the part of that "@connect list"

// @name         My Script
// @namespace    /
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        url/*
// @grant        GM_xmlhttpRequest
// @grant        GM_getValue
// @grant        GM_setValue
// @require      .4.2/jquery.min.js
// @require      .cookie.js
// @connect      /

So where's the problem?

I have a small problem, I have a script (I'm using Tampermonkey) and when I make a POST request, it says:

VM2584:33 Refused to connect to "https://my_url./sub1/sub2/": URL is not a part of the @connect list

The thing that it IS the part of that "@connect list"

// @name         My Script
// @namespace    http://tampermonkey/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        url./*
// @grant        GM_xmlhttpRequest
// @grant        GM_getValue
// @grant        GM_setValue
// @require      http://ajax.googleapis./ajax/libs/jquery/1.4.2/jquery.min.js
// @require      https://raw.githubusercontent./js-cookie/js-cookie/master/src/js.cookie.js
// @connect      https://my_url./sub1/sub2/

So where's the problem?

Share Improve this question edited Dec 5, 2016 at 18:49 Brock Adams 93.7k23 gold badges241 silver badges305 bronze badges asked Dec 5, 2016 at 17:30 MessonMesson 1172 silver badges8 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

Refer to the documentation for the @connect directive. It takes a domain, not a URL.

So your @connect statement(s) would be like:

// @connect my_url.

本文标签: javascriptconnect tag not working in TampermonkeyStack Overflow