특수 HTML 버튼을 클릭하면 새 탭이 열리는 addon에서 작업하고 있습니다. 지금, html 파일은 전용 웹 공간에 있습니다. 그러나 거기에 대한 해결책이 있습니다. 즉, html 파일을 addon 자체의 데이터 구조에 넣고 거기에서 액세스 할 수 있습니까? 문제는 단추를 연결하여 URL을 클릭 할 때 활성 사이트의 URL을 전달하고 해당 HTML 내에서 AngularJS를 사용하여 문제가있는 것입니다.firefox addon에서 html 파일에 액세스
내 코드 :
하는 index.js :
var { ActionButton } = require("sdk/ui/button/action");
var tabs = require("sdk/tabs");
var data = require("sdk/self").data;
var button = ActionButton({
id: "my-button",
label: "Start LLIBrowser",
icon: {
"16": "./img/logo-16.png"
},
onClick: showPlugIn
});
function showPlugIn(state){
let currUrl = tabs.activeTab.url;
//var file = "file:///home/janine/OneDrive/Uni/OvGU/4. Semester/SoftwareProjekt/LLIBrowserGalleryAndInfo/data/overlay.html"; just for testing
var file = "http://www-e.uni-magdeburg.de/jpolster/LLIBrowser/overlay.html";
var completePath = file.concat("?url=").concat(currUrl);
tabs.open(completePath)
}
어떤 아이디어?
건배!