Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'd like to write my own local webapps userscripts, but I don't want to compile and install the main webapps source code every time.

I would like to keep the original Ubuntu Webapps package installed, but use my local userscripts as well. Is this possible?

share|improve this question
add comment

2 Answers

What you could do is create your userscript and symlink it to /usr/share/unity-webapps/userscripts/unity-webapps-$NAME/$NAME.user.js:

($MYSCRIPTPATH is the full path to your script, probably somewhere in your home directory;$NAME is the name of your script)

sudo mkdir /usr/share/unity-webapps/userscripts/unity-webapps-$NAME
sudo ln -s $MYSCRIPTPATH /usr/share/unity-webapps/userscripts/unity-webapps-$NAME/$NAME.user.js

You'll also need to manually create a manifest file on /usr/share/unity-webapps/userscripts/unity-webapps-$NAME/manifest.json - you can just copy one from the other apps in the userscripts dir and modify the values according to your webapp.

share|improve this answer
    
You have to add your script in /usr/share/unity-webapps/userscripts/config.xml as well. Just copy and modify another entry. –  Alistair Buxton Oct 14 '12 at 2:32
    
@AlistairBuxton, does this still apply? I can't find the /usr/share/unity-webapps/userscripts/config.xml file anywhere on my system. –  David Planella Oct 20 '12 at 8:59
    
It still applies to 12.04. –  Alistair Buxton Oct 20 '12 at 9:08
    
Can you tell me how to compile webapps userscripts? –  Rajat Saxena Oct 26 '12 at 8:43
    
config.xml seems to be not needed in 12.10 –  Pisu Jan 6 '13 at 18:27
show 1 more comment

I found an easy and secure way to create custom web apps: using Firefox and the Greasemonkey extension. In Greasemonkey, it's enough to create a user script like this (I've created for Asana):

// ==UserScript==
// @name        Asana
// @namespace   app.asana.com
// @include     https://app.asana.com/*
// @grant       none
// @version     1
// ==/UserScript==

window.Unity = external.getUnityObject(1);

Unity.init({ name: 'Asana',
             domain: 'app.asana.com',
             homepage: 'https://app.asana.com/',
             iconUrl: 'http://asana.com/assets/FluidIcon.png' 
});

This script simply enable the Unity integration, but you can add other features writing more code.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.