Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 4693  / 2 Years ago, mon, april 18, 2022, 9:32:43

I'm trying to create some webapps to use with Firefox. I got an tutorial from Canonical (http://developer.ubuntu.com/resources/app-developer-cookbook/unity/integrating-tumblr-to-your-desktop/) and I didn't understand one thing, maybe someone could help me.



I have to run the following script in Web Console:



// ==UserScript==
// @name tumblr-unity-integration
// @include https://tumblr.com/dashboard
// @version @VERSION@
// @author WebApps Team
// @require utils.js
// ==/UserScript==

window.Unity = external.getUnityObject(1.0);

Unity.init({ name: "Tumblr",
iconUrl: "icon://Tumblr",
onInit: null });


Everything is fine, it created the icon launcher and work with alt+tab. That enough for me by now, but, if I close the windows, the launcher icon that I created before stop working (I mean, it open the site, but doesn't work like other webapp and doesn't show in alt+tab too). Maybe I have to run this script automatically every time I enter on that site (In this example, Tumblr). How can I do that?



Thanks,


More From » unity

 Answers
0

Yes you are right. You need to execute that again.



Basically webapps are user scripts which are executed everytime you enter on a determined website (in your case, https://tumblr.com/dashboard), which then provides the integration the website on the Unity desktop.



So if you want to make that "permanent" (execute that code everytime you enter on the website), either you can include that js on the website (if you own it) or use something like GreaseMonkey or TamperMonkey to include that script on websites which you do not control.



Of course, you can also create a package: see the source of unity-webapps-youtube for example.


[#32172] Monday, April 18, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
irripri

Total Points: 164
Total Questions: 111
Total Answers: 107

Location: South Georgia
Member since Sun, Aug 8, 2021
3 Years ago
irripri questions
Mon, Aug 29, 22, 03:19, 2 Years ago
Thu, Mar 30, 23, 01:56, 1 Year ago
Thu, Dec 30, 21, 08:53, 2 Years ago
;