LoginSignup
8
9

More than 5 years have passed since last update.

Chrome拡張のポップアップでCDNのjQueryを読み込む

Last updated at Posted at 2014-08-03

セキュリティ的な制約から割と面倒だったのでメモ。

manifest.jsonに

manifest.json
{
"content_security_policy": "script-src 'self' 'unsafe-eval' https://ajax.googleapis.com/ ; object-src 'self’"
}

を追加し、popup.htmlで

popup.html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

と書くだけ。

ただし、popup.htmlでしか使えないので、
background.htmlとかで使いたい場合はやっぱりローカルに入れる必要がある模様。

8
9
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
8
9