당신은 당신은 파이어 폭스 OS의 보일러 https://github.com/robnyman/Firefox-OS-Boilerplate-App/와 라이브 예제를 테스트 할 수있는 주 활동
// imgToShare is the image you want to set as wallpaper
var shareImage = document.querySelector("#share-image"),
imgToShare = document.querySelector("#image-to-share");
if (shareImage && imgToShare) {
shareImage.onclick = function() {
if(imgToShare.naturalWidth > 0) {
// Create dummy canvas
var blobCanvas = document.createElement("canvas");
blobCanvas.width = imgToShare.width;
blobCanvas.height = imgToShare.height;
// Get context and draw image
var blobCanvasContext = blobCanvas.getContext("2d");
blobCanvasContext.drawImage(imgToShare, 0, 0);
// Export to blob and share through a Web Activitiy
blobCanvas.toBlob(function (blob) {
new MozActivity({
name: "share",
data: {
type: "image/*",
number: 1,
blobs: [blob]
}
});
});
}
else {
alert("Image failed to load, can't be shared");
}
};
}
를 사용하여이 작업을 수행 할 수 있습니다.
나는 이것을 시험해 보겠다. 정말 고맙습니다! –
내 솔루션이 작동합니까? – fharper
프레드릭 - 아직 테스트 할 기회가 없으므로 주말이 끝날 때까지 알려 드릴 수 있습니다. 다시 한번 감사드립니다. –