Fix #2168 Use a different l10n string for sites opened in no container
This commit is contained in:
parent
b69b839fa4
commit
222d4e7d37
3 changed files with 35 additions and 5 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit 26e17db70ce276ab5ccb5ae582e5c142f12ba655
|
Subproject commit 66bcca02c98ca6739e9722f9ce80c4c71161a24b
|
|
@ -23,8 +23,21 @@
|
||||||
</label>
|
</label>
|
||||||
<br />
|
<br />
|
||||||
<div class="button-container">
|
<div class="button-container">
|
||||||
<button id="deny" class="button" data-message-id="openInContainer" data-message-arg="current-container-name"></button>
|
<button id="deny"
|
||||||
<button id="confirm" class="button primary" autofocus data-message-id="openInContainer" data-message-arg="container-name"></button>
|
class="button"
|
||||||
|
data-message-id="openInContainer"
|
||||||
|
data-message-arg="current-container-name">
|
||||||
|
</button>
|
||||||
|
<button id="deny-no-container"
|
||||||
|
class="button"
|
||||||
|
data-message-id="openInNoContainer">
|
||||||
|
</button>
|
||||||
|
<button id="confirm"
|
||||||
|
class="button primary"
|
||||||
|
autofocus
|
||||||
|
data-message-id="openInContainer"
|
||||||
|
data-message-arg="container-name">
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</main>
|
</main>
|
||||||
|
|
|
@ -12,9 +12,14 @@ async function load() {
|
||||||
denySubmit(redirectUrl);
|
denySubmit(redirectUrl);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
document.getElementById("deny-no-container").addEventListener("click", (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
denySubmit(redirectUrl);
|
||||||
|
});
|
||||||
|
|
||||||
const container = await browser.contextualIdentities.get(cookieStoreId);
|
const container = await browser.contextualIdentities.get(cookieStoreId);
|
||||||
const currentContainer = currentCookieStoreId ? await browser.contextualIdentities.get(currentCookieStoreId) : null;
|
const currentContainer = currentCookieStoreId ? await browser.contextualIdentities.get(currentCookieStoreId) : null;
|
||||||
const currentContainerName = currentContainer ? currentContainer.name : "";
|
const currentContainerName = currentContainer ? setDenyButton(currentContainer.name) : setDenyButton("");
|
||||||
|
|
||||||
document.querySelectorAll("[data-message-id]").forEach(el => {
|
document.querySelectorAll("[data-message-id]").forEach(el => {
|
||||||
const elementData = el.dataset;
|
const elementData = el.dataset;
|
||||||
|
@ -28,6 +33,18 @@ async function load() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setDenyButton(currentContainerName) {
|
||||||
|
const buttonDeny = document.getElementById("deny");
|
||||||
|
const buttonDenyNoContainer = document.getElementById("deny-no-container");
|
||||||
|
|
||||||
|
if (currentContainerName) {
|
||||||
|
buttonDenyNoContainer.style.display = "none";
|
||||||
|
return currentContainerName;
|
||||||
|
}
|
||||||
|
buttonDeny.style.display = "none";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
function appendFavicon(pageUrl, redirectUrlElement) {
|
function appendFavicon(pageUrl, redirectUrlElement) {
|
||||||
const origin = new URL(pageUrl).origin;
|
const origin = new URL(pageUrl).origin;
|
||||||
const favIconElement = Utils.createFavIconElement(`${origin}/favicon.ico`);
|
const favIconElement = Utils.createFavIconElement(`${origin}/favicon.ico`);
|
||||||
|
|
Loading…
Add table
Reference in a new issue