Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/manifest.json

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why isn't this merged?

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"manifest_version": 2,
"manifest_version": 3,
"name": "Az Mask",
"version": "1.1.8",
"description": "Does it's best to find and conceal sensitive Azure information found in the portal views",
Expand All @@ -8,7 +8,7 @@
"48": "/icons/icon48.png",
"128": "/icons/icon128.png"
},
"browser_action": {
"action": {
"default_icon": "/icons/icon16.png",
"default_popup": "/popout/popout.html"
},
Expand All @@ -31,7 +31,9 @@
],
"permissions": [
"activeTab",
"storage",
"storage"
],
"host_permissions": [
"*://*.portal.azure.com/*",
"*://portal.azure.com/*",
"*://functions.azure.com/*",
Expand Down
26 changes: 19 additions & 7 deletions src/popout/popout.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ let allMasksEnabled = true;
let allMasksCheckbox = document.getElementById('toggle-all-masks');
allMasksCheckbox.addEventListener('click', toggleAllMasks);

chrome.tabs.executeScript(
chrome.scripting.executeScript(
{
code: "document.body.classList.contains('az-mask-enabled');",
function: isAzMaskClassFound,
allFrames: true
},
results => {
Expand All @@ -16,6 +16,10 @@ chrome.tabs.executeScript(
}
);

function isAzMaskClassFound() {
return document.body.classList.contains('az-mask-enabled');
}

function toggleAllMasks() {
allMasksEnabled = !allMasksEnabled;
chrome.storage.local.set({ isMasked: allMasksEnabled }, () => {
Expand All @@ -24,20 +28,28 @@ function toggleAllMasks() {
}

function injectEnableAllMasks() {
chrome.tabs.executeScript({
code: "document.body.classList.add('az-mask-enabled');",
chrome.scripting.executeScript({
function: addAzMaskClass,
allFrames: true
});
}

function injectDisableAllMasks() {
chrome.tabs.executeScript({
code: "document.body.classList.remove('az-mask-enabled');",
chrome.scripting.executeScript({
function: removeAzMaskClass,
allFrames: true
});
}

document.addEventListener('DOMContentLoaded', function() {
function addAzMaskClass() {
return document.body.classList.add('az-mask-enabled');
}

function removeAzMaskClass() {
return document.body.classList.remove('az-mask-enabled');
}

document.addEventListener('DOMContentLoaded', function () {
var y = document.getElementById('index_link');
y.addEventListener('click', openIndex);
});
Expand Down