Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
28 lines
655 B
JavaScript
Executable file
28 lines
655 B
JavaScript
Executable file
/* global UrlHelper, AppWindow, BrowserConfigHelper */
|
|
|
|
(function() {
|
|
|
|
'use strict';
|
|
|
|
function handleOpenUrl(url) {
|
|
var config = new BrowserConfigHelper({url: url});
|
|
config.oop = true;
|
|
var newApp = new AppWindow(config);
|
|
|
|
newApp.requestOpen();
|
|
}
|
|
|
|
function handleActivity(activity) {
|
|
// Activities can send multiple names, right now we only handle
|
|
// one so we only filter on types
|
|
var data = activity.source.data;
|
|
switch (data.type) {
|
|
case 'url':
|
|
handleOpenUrl(UrlHelper.getUrlFromInput(data.url));
|
|
break;
|
|
}
|
|
}
|
|
|
|
window.navigator.mozSetMessageHandler('activity', handleActivity);
|
|
|
|
}());
|