0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Chrome拡張でajax通信時にクロスドメインのエラーの対処

Last updated at Posted at 2020-04-16

【コメントで質問OKです】
Chrome拡張で下記の様にajaxでgetを実施すると
『CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.』
が発生

    $.ajax({type: 'GET',url: TGVC.sru + "/api/room/event_and_support?room_id=" + roomID, async: false})
    .done(function(re) {
        console.log(re);
    })
    .fail(function() {
    });

クロスドメインで怒られたら(XMLHttpRequest)
上記を参照しマニフェストのpermissionsにURLを追加

    "permissions": ["tabs","https://www.showroom-live.com/"],
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?