|
14 | 14 | let uri = makeURI("data:text/css;charset=UTF=8," + encodeURIComponent(css));
|
15 | 15 | if (!sss.sheetRegistered(uri, sss.AUTHOR_SHEET))
|
16 | 16 | sss.loadAndRegisterSheet(uri, sss.AUTHOR_SHEET);
|
| 17 | + /* necessary DOM: |
| 18 | + <tooltip id="tabbrowser-tab-tooltip" |
| 19 | + class="places-tooltip" |
| 20 | + onpopupshowing="gBrowser.createTooltip(event);" |
| 21 | + onpopuphiding="this.removeAttribute('position')"> |
| 22 | + <vbox class="places-tooltip-box" flex="1"> |
| 23 | + <description class="tooltip-label places-tooltip-title"/> |
| 24 | + <hbox> |
| 25 | + <image id="places-tooltip-insecure-icon"></image> |
| 26 | + <description crop="center" class="tooltip-label places-tooltip-uri uri-element"/> |
| 27 | + </hbox> |
| 28 | + </vbox> |
| 29 | + </tooltip> */ |
17 | 30 | /**
|
18 | 31 | * for a given tab on which the tooltip is anchored, set the tooltip icon accordingly.
|
19 | 32 | * for a secure tab, use the lock icon. for an insecure tab, use the insecure icon.
|
|
22 | 35 | * @param {object} icon (the tooltip icon's DOM node)
|
23 | 36 | * @param {object} tab (the tab's DOM node)
|
24 | 37 | */
|
25 |
| - function configureIcon(icon, tab) { |
| 38 | + function setIdentityIcon(icon, tab) { |
26 | 39 | let { linkedBrowser } = tab;
|
27 | 40 | let pending = tab.hasAttribute("pending") || !linkedBrowser.browsingContext;
|
28 | 41 | let docURI = pending
|
|
182 | 195 | title.textContent = label;
|
183 | 196 | let url = e.target.querySelector(".places-tooltip-uri");
|
184 | 197 | url.value = tab.linkedBrowser?.currentURI?.spec.replace(/^https:\/\//, "");
|
185 |
| - configureIcon(e.target.querySelector("#places-tooltip-insecure-icon"), tab); |
| 198 | + setIdentityIcon(e.target.querySelector("#places-tooltip-insecure-icon"), tab); |
186 | 199 | };
|
187 | 200 | })();
|
0 commit comments