사용자의 새 탭 화면을 대체하는 Chrome 확장 프로그램입니다.Chrome 확장 프로그램에 jQuery가로드되지 않는 이유는 무엇입니까?
내 HTML의 'hello'가 경고하지 않기 때문에 jQuery가로드되지 않습니다. 매니페스트 또는 HTML에서 jQuery를로드해야합니까? 어느 것이 든 나는 HTML이 같은 장소에 있어야한다고 생각합니다.
의 manifest.json :
{
"manifest_version": 2,
"name": "Some title",
"description": "Some description.",
"version": "1.0",
"chrome_url_overrides": {
"newtab": "index.html"
},
"content_scripts": [
{
"matches": ["newtab"],
"css": ["style.css"],
"js": ["jquery.js"]
}
]
}
index.html을 명시 적으로 manifest.json
에 권한을 지정하지 않고 크롬 확장에 원격 위치에서 스크립트를로드 할 수 없습니다
<html>
<head>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script>
$(document).ready(function() {
alert("hello");
$(function(){
$('#container').masonry({
// options
itemSelector : '.item',
columnWidth : 300
});
});
</script>
</head>
<body>
<!-- etc -->
두 번째 옵션을 사용해 보았습니다. 위와 같이 콘텐츠 스크립트와 HTML을 통해로드하고 있지만 CSS는 콘텐츠 스크립트에로드되지 않으며 jQuery가 전혀로드되지 않습니다. – Sebastian