WebStart [launchable] 구성으로 다시 작업하는 스윙 응용 프로그램이 있습니다. 내 JNLP가 거의 다 왔지만, 당황 스럽지만 다음 단계는 Chrome 컨텍스트 메뉴에 링크하는 것입니다.Google 크롬 컨텍스트 메뉴에서 맞춤 확장 프로그램을 통해 JNLP를 실행하려고합니다.
응용 프로그램은 JSON 뷰어/조작기로서 현재 JSON 파일에 대한 URL을 가져 와서 JFrame으로 가져 와서 JSON 트리를 구문 분석하여 탐색 할 수 있도록합니다. 언급했듯이 현재 검색하고 형식을 지정하는 URL을 제공해야합니다.
Chrome에서 JSON 파일로 이동하여 'JSON 뷰어에서보기'를 마우스 오른쪽 버튼으로 클릭하면됩니다. 예제 Proof Of Concept의 경우 [jnlp 파일을로드하는 중] 예제로 제공되는 Oracle의 메모장 jnlp를 사용하고 있습니다.
내 기본의 manifest.json 파일과 자바 스크립트 항목을 만든 다음 "deployJava.js"파일의 일부를 어린이 침대 시도한
매니페스트 파일 :
{
"name": "JSON Viewer",
"version": "1.0",
"manifest_version": 2,
"description": "Launch JSON viewer.",
"browser_action": {
"default_icon": "icon.png"
},
"permissions": [ "contextMenus" ],
"background": {
"scripts": ["jsonview.js"]
}
}
자바 스크립트 파일 :
var title = "Edit JSON";
var id = chrome.contextMenus.create({"title": title, "contexts": ["page"],
"onclick": loadJsonViewer });
console.log("'" + context + "' item:" + id);
function loadJsonViewer(info, tab) {
//info is OnLoadData
alert(info.pageUrl);
var url = "http://java.sun.com/javase/technologies/desktop/javawebstart/apps/notepad.jnlp";
launchWebStartApplication(url);
}
// launch the specified JNLP application using the passed in jnlp file
// the jnlp file does not need to have a codebase
// this requires JRE 7 or above to work
// if machine has no JRE 7 or above, we will try to auto-install and then launch
/(function will return false if JRE auto-install failed)
function launchWebStartApplication (jnlp) {
var jnlpDocbase = null;
// use document.documentURI for docbase
if (document.documentURI) {
jnlpDocbase = document.documentURI;
}
// fallback to document.URL if documentURI not available
if (jnlpDocbase == null) {
jnlpDocbase = document.URL;
}
document.location = jnlp;
return true;
}
지금까지 내 시도에 매우 실패한 있었어 :(
M y 생각 패턴은 필자가 JNLP를 시작하는 실제 라인을 꺼내려고한다는 것이 었습니다. JNLP를 임베딩하거나 임베디드 (launch) 버튼을 만들지는 않았지만 (보통은 그렇듯이) 저는 정당한 방법으로 벗어났습니다.
이 경로를 따라 가기에 가장 중요한 질문은 다음과 같습니다. 그렇다면 embedd 태그를 '무시'하는 가장 좋은 방법은 애플릿을 호출하고 애플릿을 만드는 데 필요한 것처럼 보입니다.
완벽한, 정말 고마워! –