Skip to content

Commit d7ccea2

Browse files
committed
NoScript Options/Appearance/Show synthetic placeholders for invisible capability probes (issue #369).
1 parent 1dfc0af commit d7ccea2

5 files changed

Lines changed: 16 additions & 1 deletion

File tree

src/_locales/en/messages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@
155155
"ShowFullAddresses": {
156156
"message": "List full addresses in the permissions popup (https://www.noscript.net)"
157157
},
158+
"ShowProbePlaceholders": {
159+
"message": "Show synthetic placeholders for invisible capability probes"
160+
},
158161
"SectionGeneral": {
159162
"message": "General"
160163
},

src/bg/Defaults.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ var Defaults = {
2828
showCtxMenuItem: true,
2929
showCountBadge: true,
3030
showFullAddresses: false,
31+
showProbePlaceholders: true,
3132
amnesticUpdates: false,
3233
},
3334
sync: {

src/bg/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,13 @@
230230
});
231231
},
232232
async getTheme(msg, {tab, frameId}) {
233+
let code = await Themes.getContentCSS();
234+
if (!ns.local.showProbePlaceholders) {
235+
code += `\n.__NoScript_Offscreen_PlaceHolders__ {display: none }`;
236+
}
233237
try {
234238
browser.tabs.insertCSS(tab.id, {
235-
code: await Themes.getContentCSS(),
239+
code,
236240
frameId,
237241
runAt: "document_start",
238242
matchAboutBlank: true,

src/ui/options.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ <h3 class="flextabs__tab appearance_tab"><button class="flextabs__toggle">__MSG_
108108
<label for="opt-showFullAddresses" id="lbl-showFullAddresses">__MSG_ShowFullAddresses__</label>
109109
</span>
110110
</div>
111+
<div class="opt-group">
112+
<span id="showProbePlaceholders-opt">
113+
<input type="checkbox" id="opt-showProbePlaceholders">
114+
<label for="opt-showProbePlaceholders" id="lbl-showProbePlaceholders">__MSG_showProbePlaceholders__</label>
115+
</span>
116+
</div>
111117
<section id="sect-themes">
112118
<fieldset id="themes">
113119
<legend>__MSG_settingsThemeLabel__</legend>

src/ui/options.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ document.querySelector("#version").textContent = _("Version",
154154
opt("showCountBadge", "local");
155155
opt("showCtxMenuItem", "local");
156156
opt("showFullAddresses", "local");
157+
opt("showProbePlaceholders", "local");
157158

158159
UI.wireChoice("theme", o => Themes.setup(o && o.value) );
159160
opt("vintageTheme", async o => await (o ? Themes.setVintage(o.checked) : Themes.isVintage()));

0 commit comments

Comments
 (0)