xiMatrix

filter net requests according to source, destination and type  https://addons.mozilla.org/firefox/addon/ximatrix/
git clone https://git.ce9e.org/xiMatrix.git

commit
f09545d24f54e589157af80deafd218cf57556f8
parent
8eb7e754e53d225f60e233301c8ef9770d041778
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2025-10-05 08:04
prompt for host permissions when not available

Diffstat

M src/popup.html 1 +
M src/popup.js 17 ++++++++++++++++-

2 files changed, 17 insertions, 1 deletions


diff --git a/src/popup.html b/src/popup.html

@@ -7,6 +7,7 @@
    7     7 <body>
    8     8 	<table></table>
    9     9 	<div class="toolbar">
   -1    10 		<button type="button" name="permissions" hidden>Unlock necessary permissions</button>
   10    11 		<button type="button" name="commit" disabled>Commit</button>
   11    12 		<button type="button" name="reset" disabled>Reset</button>
   12    13 		<button type="button" name="settings">Edit rules</button>

diff --git a/src/popup.js b/src/popup.js

@@ -9,6 +9,11 @@ var rules;
    9     9 const table = document.querySelector('table');
   10    10 const commitButton = document.querySelector('[name="commit"]');
   11    11 const resetButton = document.querySelector('[name="reset"]');
   -1    12 const permissionsButton = document.querySelector('[name="permissions"]');
   -1    13 
   -1    14 const permissions = {
   -1    15     origins: ['<all_urls>'],
   -1    16 };
   12    17 
   13    18 const sendMessage = async function(type, data) {
   14    19     return await browser.runtime.sendMessage({type: type, data: data});
@@ -164,7 +169,12 @@ document.querySelector('[name="settings"]').addEventListener('click', () => {
  164   169 });
  165   170 
  166   171 document.addEventListener('DOMContentLoaded', async () => {
  167    -1     await loadContext();
   -1   172     var hasPermissions = await browser.permissions.contains(permissions);
   -1   173     if (hasPermissions) {
   -1   174         await loadContext();
   -1   175     } else {
   -1   176         permissionsButton.hidden = false;
   -1   177     }
  168   178 });
  169   179 
  170   180 commitButton.addEventListener('click', async () => {
@@ -177,3 +187,8 @@ resetButton.addEventListener('click', async () => {
  177   187     await sendMessage('reset', context);
  178   188     await loadContext();
  179   189 });
   -1   190 
   -1   191 permissionsButton.addEventListener('click', async () => {
   -1   192     await browser.permissions.request(permissions);
   -1   193     window.close();
   -1   194 });