From 743cb7e2184fff16c71817f78a17daef3cc01752 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Fri, 11 Oct 2013 16:44:00 +0200 Subject: More attempts towards changing the app into activity handler. --- importAddrBook.js | 12 ++++++++++++ manifest.webapp | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/importAddrBook.js b/importAddrBook.js index 97f4466..ebbd358 100644 --- a/importAddrBook.js +++ b/importAddrBook.js @@ -168,6 +168,18 @@ document.body.addEventListener("submit", submitHandler, false); + + navigator.mozSetMessageHandler('activity', function(activityRequest) { + var option = activityRequest.source; + + if ((option.name === "view") || (option.name === "open")) { + // Do something to handle the activity + console.log("option.data = " + option.data); +// var URL = document.getElementsByName("URL")[0].value; + + } + }); + }; }()); diff --git a/manifest.webapp b/manifest.webapp index cbd931a..f86fa2e 100644 --- a/manifest.webapp +++ b/manifest.webapp @@ -18,6 +18,18 @@ }, "disposition": "inline", "href": "/index.html" + }, + "view": { + "filters": { + "type": "url", + "url": { + "required": true, + "regexp": "\\.ldif$", + "pattern": "\\.ldif$" + } + }, + "disposition": "inline", + "href": "/index.html" } }, "permissions": { -- cgit