나는 작업을 chrome 브라우저에서 확장. 을 연결하는 중포 기지와에서 웹 앱은 2 가지 방법이 없음이 작동하는 것입니다.
- "를 사용하여 본원에 설치 중포 기지" 가 이 명령을 설치 중포 기지로 프로젝트 폴더에 쓰 fireConn.js 파일와 함께 구성에서 있어 중포 기지로 만들어지는 프로젝트 온라인.
import {initializeApp} from 'firebase/app';
import {getFirestore} from 'firebase/firestore';
는 오류 나가
Uncaught TypeError: Failed to resolve module specifier "firebase/app". Relative references must start with either "/", "./", or "../".
- 를 사용하는 https://www.gstatic.com/firebasejs/9.4.1/firebase-app.js url 을 연결 얻을 중포 기지
import {initializeApp} from "https://www.gstatic.com/firebasejs/9.4.1/firebase-app.js";
import {getFirestore} from "https://www.gstatic.com/firebasejs/9.4.1/firebase-firestore.js";
으로 프로젝트는 크롬 확장 프로그램,내가 나타납니다.json 하는 파일 형식은 다음과 같습니다:
{
"name": "xxx",
"manifest_version": 3,
"version": "1.0",
"permissions": ["cookies","tabs"],
"host_permissions": ["<all_urls>"],
"action": {
"default_popup": "popup.html"
},
"content_security_policy": {
"extension_pages": "script-src 'self'; object-src 'self'",
"sandbox": "sandbox allow-scripts; script-src 'self' 'https://apis.google.com/' 'https://www.gstatic.com/' 'https://*.firebaseio.com' 'https://www.googleapis.com' 'https://ajax.googleapis.com'; object-src 'self'"
}
}
오류가 점점:(뭔가 잘못으로 content_security_policy)
Refused to load the script 'https://www.gstatic.com/firebasejs/9.4.1/firebase-firestore.js' because it violates the following Content Security Policy directive: "script-src 'self'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.