Skip to content

Commit 75c8b05

Browse files
committed
Add button to clear container permissions
1 parent 866e713 commit 75c8b05

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/ui/options.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ fieldset:disabled {
8484
#newsite {
8585
flex: 2 2;
8686
}
87+
#btn-clear-container {
88+
margin-top: .5em;
89+
}
8790

8891
#policy {
8992
display: block;

src/ui/options.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ <h3 class="flextabs__tab"><button class="flextabs__toggle enforcement_required">
8282
<div class="cssload-whirlpool"></div>
8383
</div>
8484
</div>
85+
<button id="btn-clear-container">Clear permissions for this container</button>
8586
</section>
8687
</div>
8788

src/ui/options.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,15 @@
240240
sitesUI.onChange();
241241
}
242242
}, true);
243+
244+
document.querySelector("#btn-clear-container").addEventListener("click", async ev => {
245+
if (confirm("All site permissions for this container will be removed.\nThis action cannot be reverted.\nDo you want to continue?")) {
246+
sitesUI.clear()
247+
currentPolicy.sites = Sites.hydrate({});
248+
await UI.updateSettings({policy, contextStore});
249+
sitesUI.render(currentPolicy.sites);
250+
}
251+
});
243252
}
244253

245254

0 commit comments

Comments
 (0)