Mercurial > addons > firefox-addons > open-incognito
annotate Makefile @ 3:89239e60d9e1 default tip
Enable on privileged pages
There are contexts in Firefox (for example, the default new tab page) that
contain links to http(s) resources but are considered privileged. In these
contexts `menus.onShown` does not provide the link URL to the extension and
Open Incognito disables the context menu entry.
However, if the entry is not disabled, the `onClicked` listener will actually
know the link URL because a user's click on the extension's menu item is
considered to be an explicit permission, so Open Incognito could work.
Keep the menu item enabled if the URL is not available. There is a drawback
that the item will be enabled but do nothing if the actual link has an
unknown/unsupported protocol, but this is probably a more rare situation.
author | Denis Lisov <dennis.lissov@gmail.com> |
---|---|
date | Sat, 09 Feb 2019 03:38:05 +0300 |
parents | 3353f3c48b6b |
children |
rev | line source |
---|---|
0
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
1 # |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
2 # Copyright (C) 2018 Guido Berhoerster <guido+open-incognito@berhoerster.name> |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
3 # |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
4 # Permission is hereby granted, free of charge, to any person obtaining |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
5 # a copy of this software and associated documentation files (the |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
6 # "Software"), to deal in the Software without restriction, including |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
7 # without limitation the rights to use, copy, modify, merge, publish, |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
8 # distribute, sublicense, and/or sell copies of the Software, and to |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
9 # permit persons to whom the Software is furnished to do so, subject to |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
10 # the following conditions: |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
11 # |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
12 # The above copyright notice and this permission notice shall be included |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
13 # in all copies or substantial portions of the Software. |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
14 # |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
16 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
17 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
18 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
19 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
20 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
21 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
22 # |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
23 |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
24 NAME = open-incognito |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
25 VERSION = 1 |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
26 EXT_NAME = $(subst -,_,$(NAME))-$(VERSION) |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
27 |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
28 INKSCAPE := inkscape |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
29 INFOZIP := zip |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
30 SED := sed |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
31 |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
32 BITMAP_ICONS = icons/open-incognito-48.png \ |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
33 icons/open-incognito-96.png |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
34 DIST_FILES = manifest.json \ |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
35 COPYING \ |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
36 NEWS \ |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
37 README \ |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
38 $(wildcard _locales/*/messages.json) \ |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
39 background.js \ |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
40 $(BITMAP_ICONS) |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
41 |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
42 .DEFAULT_TARGET = all |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
43 |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
44 .PHONY: all extension clean clobber |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
45 |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
46 all: extension |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
47 |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
48 extension: $(EXT_NAME).zip |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
49 |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
50 $(EXT_NAME).zip: $(DIST_FILES) |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
51 $(INFOZIP) $@ $^ |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
52 |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
53 define generate-icon-rule |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
54 $1: $(1:%-$(lastword $(subst -, ,$1))=%.svg) |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
55 size=$(lastword $(subst -, ,$(basename $1))); \ |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
56 $(INKSCAPE) -w $$$${size} -h $$$${size} -e $$@ $$< |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
57 endef |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
58 |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
59 $(foreach icon,$(BITMAP_ICONS),$(eval $(call generate-icon-rule,$(icon)))) |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
60 |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
61 manifest.json: manifest.json.in |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
62 $(SED) 's|@VERSION@|$(VERSION)|g' $< >$@ |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
63 |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
64 clean: |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
65 -rm -f $(BITMAP_ICONS) manifest.json |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
66 |
3353f3c48b6b
Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff
changeset
|
67 clobber: clean |