<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ExtensionInstallAllowlist Opener</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
margin: 20px;
line-height: 1.6;
}
textarea {
width: 100%;
height: 150px;
margin-bottom: 10px;
border-radius: 5px;
resize: none;
}
button {
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
}

error {

        color: #ff757e;
        margin-top: 10px;
    }
    #outputLog {
        text-align: left;
        margin-top: 20px;
        padding: 10px;
        border: 1px solid #ccc;
        max-height: 300px;
        overflow-y: auto;
        border-radius: 5px;
    }
    .logEntry {
        display: flex;
        align-items: center;
        margin-bottom: 5px;
    }
    .timestamp {
        color: gray;
        font-size: 0.8em;
        user-select: none; /* Prevent text selection */
        margin-right: 10px; /* Space between timestamp and link */
    }
    * {
        background-color: black;
        color: rgb(196, 196, 196);
        font-family: monospace;
    }
    input,button {
        background-color: #131313;
        border: #0a0a0a;
        border-width: 3px;
        border-radius: 3px;
        border-style: solid;
        margin: 1.4px;
        cursor: pointer;
    }
    .link-text {
        color: #19ffc2;
        text-decoration-style: wavy;
    }
</style>

</head>
<body>
<h1><code style="color:#8c19ff;">ExtensionInstallAllowlist</code> Opener</h1>
<p>Type in <a href="chrome://policy" target="_blank" class="link-text">chrome://policy</a> in the URL bar.<br> Then search <code style="color:#8c19ff">ExtensionInstallAllowlist</code>, and then click <code style="color:#6bbaff">Show More</code>. Copy everything and paste it in here.</p>
<textarea id="jsonInput"></textarea>
<br>
<button onclick="generateLinks()">Generate Links</button>
<button id="openLinksBtn" onclick="openLinks()" disabled>Open All Links</button>
<div id="error"></div>
<div id="outputLog"></div>

<script>
    let extensionLinks = [];

    function formatTime(date) {
        const hours = String(date.getHours()).padStart(2, '0');
        const minutes = String(date.getMinutes()).padStart(2, '0');
        const seconds = String(date.getSeconds()).padStart(2, '0');
        const milliseconds = String(date.getMilliseconds()).padStart(3, '0');
        return `${hours}:${minutes}:${seconds}:${milliseconds}`;
    }

    function generateLinks() {
        const jsonInput = document.getElementById('jsonInput').value;
        const errorDiv = document.getElementById('error');
        const outputLog = document.getElementById('outputLog');
        const openLinksBtn = document.getElementById('openLinksBtn');
        errorDiv.textContent = '';
        outputLog.innerHTML = ''; // Clear previous output

        extensionLinks = []; // Reset the links array

        try {
            const extensionIds = JSON.parse(jsonInput);

            if (!Array.isArray(extensionIds)) {
                throw new Error('Make sure you pasted the ENTIRE JSON array of the ExtensionInstallAllowlist');
            }

            const timestamp = formatTime(new Date());

            // Generate and display links with timestamp
            extensionIds.forEach((id) => {
                if (typeof id === 'string' && id.trim()) {
                    const url = `https://chromewebstore.google.com/detail/${id.trim()}`;
                    extensionLinks.push(url);

                    // Append link to output log
                    const logEntry = document.createElement('div');
                    logEntry.className = 'logEntry';

                    const timestampElement = document.createElement('span');
                    timestampElement.className = 'timestamp';
                    timestampElement.textContent = `(${timestamp})`;

                    const linkElement = document.createElement('a');
                    linkElement.href = url;
                    linkElement.target = '_blank';
                    linkElement.rel = 'noopener noreferrer';
                    linkElement.textContent = url;

                    logEntry.appendChild(timestampElement);
                    logEntry.appendChild(linkElement);

                    outputLog.appendChild(logEntry);
                } else {
                    console.warn(`Invalid extension ID: ${id}`);
                }
            });

            // Enable the button to open all links
            openLinksBtn.disabled = false;

        } catch (e) {
            errorDiv.textContent = `Error: ${e.message}`;
        }
    }

    function openLinks() {
        extensionLinks.forEach((url) => {
            window.open(url, '_blank', 'noopener,noreferrer');
        });
    }
</script>

</body>
</html>

Edit Report
Pub: 10 Sep 2024 17:32 UTC
Views: 756