--- webapps-greasemonkey-2.3.6+13.10.20130920.1.orig/components/unity_webapps.js +++ webapps-greasemonkey-2.3.6+13.10.20130920.1/components/unity_webapps.js @@ -23,6 +23,10 @@ this.lib = ctypes.open("/usr/lib/libunity-webapps.so.0"); } } + this.permissions_get_domain_allowed = + this.lib.declare("unity_webapps_permissions_get_domain_allowed", + ctypes.default_abi, + ctypes.int32_t,ctypes.char.ptr); this.permissions_get_domain_dontask = this.lib.declare("unity_webapps_permissions_get_domain_dontask", ctypes.default_abi, @@ -80,6 +84,9 @@ this.application_repository_resolve_url_as_json = this.lib.declare("unity_webapps_application_repository_resolve_url_as_json", ctypes.default_abi, ctypes.char.ptr, ctypes.voidptr_t, ctypes.char.ptr); + this.application_repository_add_desktop_to_launcher = + this.lib.declare("unity_webapps_application_repository_add_desktop_to_launcher", + ctypes.default_abi, ctypes.void_t, ctypes.char.ptr); var glib = ctypes.open("libglib-2.0.so.0"); @@ -298,7 +305,14 @@ loader.loadSubScript("chrome://global/content/XPCNativeWrapper.js"); } -function suggestAppInstall(uw, uwr, repo, chromeWindow, contentWindow, appId, url) { +function createApplicationDesktopName(appName, appDomain) +{ + var basename = (appName + appDomain).replace(/[\W]+/, ''); + return "application://" + basename + ".desktop"; +} + +function suggestAppInstall(uw, uwr, repo, chromeWindow, contentWindow, appId, url, appStatus) { + let appName = uwr.application_repository_get_resolved_application_name (repo, appId); let appDomain = uwr.application_repository_get_resolved_application_domain (repo, appId); if (!appDomain.isNull() && uw.permissions_get_domain_dontask(appDomain.readString())) return; @@ -310,9 +324,6 @@ try { Cu.import("resource://unity/l10n.js"); - let appName = uwr.application_repository_get_resolved_application_name (repo, appId); - - var promptMsg = l10n.formatMessage('webappsGreasemonkey.installPrompt', [appName.readString()]); var dontaskMsg = l10n.formatMessage('prompt.dontask'); var installMsg = l10n.formatMessage('webappsGreasemonkey.install'); @@ -326,6 +337,10 @@ if (status == uwr.APPLICATION_STATUS_INSTALLED) { if (!appDomain.isNull()) { uw.permissions_allow_domain (appDomain.readString()); + if (appStatus == uwr.APPLICATION_STATUS_INSTALLED) { + // This code path from installed but not allowed webapp + uwr.application_repository_add_desktop_to_launcher(createApplicationDesktopName(appName.readString(), appDomain.readString())); + } } var scripts = []; var src = getScriptSource(uwr, repo, name); @@ -349,22 +364,27 @@ } } - chromeWindow.PopupNotifications.show(chromeWindow.gBrowser.getBrowserForDocument(contentWindow.document), - "unity-permission-popup", - promptMsg, - null, - { - label: installMsg, - accessKey: "I", - callback: installApp - }, - [ - { - label: dontaskMsg, - accessKey: "D", - callback: addToIgnoreList - } - ]); + chromeWindow.PopupNotifications.show( + chromeWindow.gBrowser.getBrowserForDocument(contentWindow.document), + "unity-permission-popup", + promptMsg, + null, + { + label: installMsg, + accessKey: "I", + callback: installApp + }, + [ + { + label: dontaskMsg, + accessKey: "D", + callback: addToIgnoreList + } + ], + { + timeout: Date.now() + 10000 + } + ); } /////////////////////////////////// Service //////////////////////////////////// @@ -481,14 +501,14 @@ if (!appDomain.isNull() && this._uw.permissions_get_domain_dontask(appDomain.readString())) continue; - switch (this._uwr.application_repository_get_resolved_application_status(this._repo, name)) { - case this._uwr.APPLICATION_STATUS_AVAILABLE: - suggestAppInstall(this._uw, this._uwr, this._repo, aChromeWin, aWrappedContentWin, name, url); - break; - case this._uwr.APPLICATION_STATUS_INSTALLED: + var appStatus = this._uwr.application_repository_get_resolved_application_status(this._repo, name); + if (appStatus === this._uwr.APPLICATION_STATUS_AVAILABLE || + (appStatus === this._uwr.APPLICATION_STATUS_INSTALLED && !this._uw.permissions_get_domain_allowed(appDomain))) { + suggestAppInstall(this._uw, this._uwr, this._repo, aChromeWin, aWrappedContentWin, name, url, appStatus); + } + else if (appStatus === this._uwr.APPLICATION_STATUS_INSTALLED) { var src = getScriptSource(this._uwr, this._repo, name); scripts.push({ name: name, content: src }); - break; } } } --- webapps-greasemonkey-2.3.6+13.10.20130920.1.orig/debian/changelog +++ webapps-greasemonkey-2.3.6+13.10.20130920.1/debian/changelog @@ -0,0 +1,159 @@ +webapps-greasemonkey (2.3.6+13.10.20130920.1-0ubuntu1.2) trusty-security; urgency=medium + + * Ship an empty package - this addon will stop working soon due to Firefox's + addon signing requirements anyway + - update debian/rules + + -- Chris Coulson Tue, 22 Sep 2015 17:50:52 +0100 + +webapps-greasemonkey (2.3.6+13.10.20130920.1-0ubuntu1.1) trusty; urgency=low + + [ Justin McPherson ] + * components/unity_webapps.js: + - Offer to install webapp if the package is already installed (LP: #1311643) + - Set a timeout value on the Notification pop-up (LP: #1311848, #1315220) + + -- Robert Bruce Park Tue, 15 Jul 2014 15:48:04 -0700 + +webapps-greasemonkey (2.3.6+13.10.20130920.1-0ubuntu1) saucy; urgency=low + + [ Robert Bruce Park ] + * Minor packaging fixes for daily release. + * Automatic snapshot from revision 873 (bootstrap) + + [ Ubuntu daily release ] + * Automatic snapshot from revision 874 + + -- Ubuntu daily release Fri, 20 Sep 2013 23:15:09 +0000 + +webapps-greasemonkey (2.3.5.2-0ubuntu1) raring; urgency=low + + [ Maxim Ermilov ] + * fix crash during gc (LP: #1164302) + + -- Robert Bruce Park Thu, 04 Apr 2013 11:22:50 -0700 + +webapps-greasemonkey (2.3.5.1-0ubuntu1) raring; urgency=low + + * Inline packaging + + -- Ken VanDine Tue, 20 Nov 2012 10:35:49 -0500 + +webapps-greasemonkey (2.3.5-0ubuntu1) quantal-proposed; urgency=low + + * New upstream release. + - Webapp prompt appears on every page load (LP: #1060888) + - Keeps asking to install packages even when responded with + don't ask (LP: #1061633) + * -debian/patches/no-shadow-repo.patch, fixed upstream + + -- Ken VanDine Thu, 11 Oct 2012 11:00:04 -0400 + +webapps-greasemonkey (2.3.4-0ubuntu1) quantal; urgency=low + + * New upstream release. + - Installation prompt is uninformative (and a bit abrasive) (LP: #1059829) + - Installation prompt should preauthorize domain (skip duplicate + permission check) (LP: #1059831) + - After installation webapps fail to load until page refresh (LP: #1059832) + - use translation mechanizm from unity-firefox-extension + - prevent duplicate install prompts + * -debian/patches/version_bump.patch, fixed upstream + + -- Ken VanDine Wed, 03 Oct 2012 22:24:24 -0400 + +webapps-greasemonkey (2.3.2-0ubuntu1) quantal; urgency=low + + * New upstream release. + - Force initialization of storage service prior to opening + UnityWebappsRepository (LP: #1058209) + - Save install callbacks to prevent them from being preemptively + garbage collected (LP: #1059441) + * debian/patches/version_bump.patch + - bump the version of the extension, upstream missed that in the release. + + -- Ken VanDine Mon, 01 Oct 2012 23:21:59 -0400 + +webapps-greasemonkey (2.3.1-0ubuntu1) quantal-proposed; urgency=low + + * Intial upload to Ubuntu (LP: #1040313) + * Rename source to match upstream + * Add Vcs-Bzr to desktop team branch + + -- Michael Terry Thu, 20 Sep 2012 15:51:18 -0400 + +xul-ext-websites-integration (2.3.1-0quantal1) quantal; urgency=low + + * New upstream release. + + -- Ken VanDine Tue, 18 Sep 2012 11:41:14 -0400 + +xul-ext-websites-integration (2.3-0quantal1) quantal; urgency=low + + * New upstream release. + + -- Ken VanDine Tue, 11 Sep 2012 16:05:54 -0400 + +xul-ext-websites-integration (1.2.0-0quantal1) quantal; urgency=low + + * rebuild for quantal + + -- Ken VanDine Mon, 16 Jul 2012 09:40:37 -0400 + +xul-ext-websites-integration (1.2.0-0precise3) precise; urgency=low + + * install.rdf + - bump maxVersion to 14.* + + -- Ken VanDine Mon, 11 Jun 2012 09:40:29 -0400 + +xul-ext-websites-integration (1.2.0-0precise2) precise; urgency=low + + * install.rdf + - bump maxVersion to 13.* + + -- Ken VanDine Tue, 22 May 2012 16:09:33 -0400 + +xul-ext-websites-integration (1.2.0-0precise1) precise; urgency=low + + * New snapshot tagged RELEASE_1.2 + + -- Ken VanDine Tue, 22 May 2012 15:44:40 -0400 + +xul-ext-websites-integration (0.10.0-0precise1+r832) precise; urgency=low + + * Merged from trunk rev 832 + + -- Ken VanDine Fri, 04 May 2012 08:46:27 -0700 + +xul-ext-websites-integration (0.10.0-0precise1) precise; urgency=low + + * New snapshot RELEASE_0.10 + + -- Ken VanDine Fri, 13 Apr 2012 16:41:42 -0400 + +xul-ext-websites-integration (0.9.4-0precise1) precise; urgency=low + + * New upstream snapshot RELEASE_0.9.4 + + -- Ken VanDine Mon, 26 Mar 2012 14:41:30 -0400 + +xul-ext-websites-integration (0.9.2-0precise1) precise; urgency=low + + * New upstream snapshot RELEASE_0.9.2 + + -- Ken VanDine Mon, 12 Mar 2012 15:04:42 -0400 + +xul-ext-websites-integration (0.9-0precise1) precise; urgency=low + + * New upstream release + + -- Ken VanDine Fri, 24 Feb 2012 16:41:14 -0500 + +xul-ext-websites-integration (0.3.1-0precise1) precise; urgency=low + + * Initial Release. + * install.rdf + - bump maxVersion to 10.* to support firefox 10 + + -- Ken VanDine Thu, 12 Jan 2012 15:03:17 +0100 --- webapps-greasemonkey-2.3.6+13.10.20130920.1.orig/debian/compat +++ webapps-greasemonkey-2.3.6+13.10.20130920.1/debian/compat @@ -0,0 +1 @@ +9 --- webapps-greasemonkey-2.3.6+13.10.20130920.1.orig/debian/control +++ webapps-greasemonkey-2.3.6+13.10.20130920.1/debian/control @@ -0,0 +1,24 @@ +Source: webapps-greasemonkey +Section: web +Priority: optional +Maintainer: Ubuntu Desktop Team +Build-Depends: debhelper (>= 9), + mozilla-devscripts, + zip, +Standards-Version: 3.9.4 +Homepage: https://launchpad.net/webapps-greasemonkey +# If you aren't a member of ~webapps but need to upload packaging changes, +# just go ahead. ~webapps will notice and sync up the code again. +Vcs-Bzr: https://code.launchpad.net/~webapps/webapps-greasemonkey/trunk + +Package: xul-ext-websites-integration +Architecture: all +Depends: libunity-webapps0, + ${misc:Depends}, + ${xpi:Depends}, +Enhances: ${xpi:Enhances}, +Provides: ${xpi:Provides}, +Recommends: ${xpi:Recommends}, +Breaks: ${xpi:Breaks}, +Description: Firefox extension: Website Integration + Firefox extension to allow Unity to integrate with Websites --- webapps-greasemonkey-2.3.6+13.10.20130920.1.orig/debian/copyright +++ webapps-greasemonkey-2.3.6+13.10.20130920.1/debian/copyright @@ -0,0 +1,76 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: xul-ext-websites-integration +Source: https://launchpad.net/webapps-greasemonkey + +Files: * +Copyright: 2004-2007 Aaron Boodman +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + Note that this license applies only to the Greasemonkey extension source + files, not to the user scripts which it runs. User scripts are licensed + separately by their authors. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +Files: components/unity_webapps.js +Copyright: 2004-2007 Aaron Boodman +License: BSD-3-clause + Redistribution and use of this software in source and binary forms, with or + without modification, are permitted provided that the following conditions are + met: + . + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + . + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + . + * Neither the name of nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Files: debian/* +Copyright: 2012 Canonical Ltd. +License: GPL-3 + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". --- webapps-greasemonkey-2.3.6+13.10.20130920.1.orig/debian/rules +++ webapps-greasemonkey-2.3.6+13.10.20130920.1/debian/rules @@ -0,0 +1,16 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +override_dh_auto_build: + sh build.sh + +override_dh_auto_install: + #install-xpi webapps*.xpi + rm -f debian/*/usr/share/xul-ext/websites-integration/LICENSE.* + +override_dh_clean: + dh_clean + rm -f *.xpi + +%: + dh $@ --with xul-ext --fail-missing --- webapps-greasemonkey-2.3.6+13.10.20130920.1.orig/debian/xul-ext-websites-integration.postinst +++ webapps-greasemonkey-2.3.6+13.10.20130920.1/debian/xul-ext-websites-integration.postinst @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +echo "Please restart all running instances of firefox, or you will experience problems." + +if [ -d /var/run ] ; then + touch /var/run/firefox-restart-required +fi + +#DEBHELPER# +