admin管理员组文章数量:1315986
When testing a Safari extension in Xcode before submit, I always get this in console:
Failed to load resource: You do not have permission to access the requested resource.
The file is a .txt dictionary file. Manifest v.2 has "web_accessible_resources": [ "diqo.txt" ]
and file is in proper folder beside the js.
This works perfectly fine in FireFox and Chrome. I imported the Firefox files to Xcode with:
xcrun safari-web-extension-converter ... --copy-resources --macos-only
in Terminal.
This is my first try at browser extensions. Tried with node, no luck. What I am missing?
// Function to load the lexicon (dictionary) from a text file
const chargerLexique = async () => {
try {
const response = await fetch(browser.runtime.getURL('DataJ/diqo.txt'));
const data = await response.text();
// Process the text content into a dictionary object
dictionnaire = data.split('\n').reduce(processLine, {} );
console.log("Lexiqe de l'extansion bien charjé");
} catch (error) {
console.error("Ereur lexiqe:", error);
}
};
本文标签: xcodeSafari web extensionStack Overflow
版权声明:本文标题:xcode - Safari web extension - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741995112a2409885.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论