mirror of
https://github.com/planetrenox/inzerosight.git
synced 2026-09-18 10:05:44 +00:00
release: inØsight 3.1.0
This commit is contained in:
49
content.js
49
content.js
@@ -69,7 +69,7 @@ function initShadow() {
|
||||
(document.body || document.documentElement).appendChild(host);
|
||||
}
|
||||
|
||||
function createOverlay(node, parsed, start, end) {
|
||||
function createOverlay(node, parsed, start, endNode, end) {
|
||||
for (const e of active) if (e.node === node && e.start === start) return;
|
||||
initShadow();
|
||||
const wrap = document.createElement('div');
|
||||
@@ -91,7 +91,7 @@ function createOverlay(node, parsed, start, end) {
|
||||
wrap.appendChild(arrow);
|
||||
shadow.appendChild(wrap);
|
||||
|
||||
const entry = { wrap, node, start, end };
|
||||
const entry = { wrap, node, start, endNode, end };
|
||||
active.add(entry);
|
||||
|
||||
btn.onclick = () => onAction(entry, parsed);
|
||||
@@ -99,8 +99,8 @@ function createOverlay(node, parsed, start, end) {
|
||||
}
|
||||
|
||||
function updatePos(entry) {
|
||||
const { wrap, node, start, end } = entry;
|
||||
if (!node.isConnected) {
|
||||
const { wrap, node, start, endNode, end } = entry;
|
||||
if (!node.isConnected || !endNode.isConnected) {
|
||||
wrap.remove();
|
||||
active.delete(entry);
|
||||
return;
|
||||
@@ -114,7 +114,7 @@ function updatePos(entry) {
|
||||
const r = document.createRange();
|
||||
try {
|
||||
r.setStart(node, start);
|
||||
r.setEnd(node, Math.min(end, node.nodeValue.length));
|
||||
r.setEnd(endNode, Math.min(end, endNode.nodeValue.length));
|
||||
} catch {
|
||||
wrap.remove();
|
||||
active.delete(entry);
|
||||
@@ -155,8 +155,11 @@ function updatePos(entry) {
|
||||
}
|
||||
|
||||
function onAction(entry, parsed) {
|
||||
const { wrap, node, start, end } = entry;
|
||||
const rawPayload = node.nodeValue.slice(start + parsed.sigLen, end);
|
||||
const { wrap, node, start, endNode, end } = entry;
|
||||
const r = document.createRange();
|
||||
r.setStart(node, start);
|
||||
r.setEnd(endNode, end);
|
||||
const rawPayload = r.toString().slice(parsed.sigLen);
|
||||
let decoded = '';
|
||||
|
||||
if (parsed.cipher === 'PLAIN') {
|
||||
@@ -184,9 +187,6 @@ function onAction(entry, parsed) {
|
||||
}
|
||||
|
||||
if (decoded) {
|
||||
const r = document.createRange();
|
||||
r.setStart(node, start);
|
||||
r.setEnd(node, end);
|
||||
r.deleteContents();
|
||||
const span = document.createElement('span');
|
||||
span.className = 'inzerosight-decoded';
|
||||
@@ -199,6 +199,27 @@ function onAction(entry, parsed) {
|
||||
}
|
||||
}
|
||||
|
||||
function getPayloadRange(node, base, start) {
|
||||
let endNode = node;
|
||||
let end = getPayloadEnd(node.nodeValue, base, start);
|
||||
|
||||
// Gmail inserts <wbr> elements into long zero-width runs, splitting one payload across text nodes.
|
||||
while (end === endNode.nodeValue.length) {
|
||||
let next = endNode.nextSibling;
|
||||
let hasWbr = false;
|
||||
while (next?.nodeType === Node.ELEMENT_NODE && next.tagName === 'WBR') {
|
||||
hasWbr = true;
|
||||
next = next.nextSibling;
|
||||
}
|
||||
if (!hasWbr || next?.nodeType !== Node.TEXT_NODE) break;
|
||||
const nextEnd = getPayloadEnd(next.nodeValue, base, 0);
|
||||
if (!nextEnd) break;
|
||||
endNode = next;
|
||||
end = nextEnd;
|
||||
}
|
||||
return { endNode, end };
|
||||
}
|
||||
|
||||
function scanNode(node) {
|
||||
if (!node || node.nodeType !== Node.TEXT_NODE) return;
|
||||
const val = node.nodeValue;
|
||||
@@ -210,9 +231,9 @@ function scanNode(node) {
|
||||
const p = parseSig(sub);
|
||||
if (!p) break;
|
||||
const start = idx + p.sigIdx;
|
||||
const end = getPayloadEnd(val, p.base, start + p.sigLen);
|
||||
createOverlay(node, p, start, end);
|
||||
idx = end + 1;
|
||||
const { endNode, end } = getPayloadRange(node, p.base, start + p.sigLen);
|
||||
createOverlay(node, p, start, endNode, end);
|
||||
idx = endNode === node ? end + 1 : val.length;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,7 +260,7 @@ function scheduleUpdate() {
|
||||
|
||||
const obs = new MutationObserver(muts => {
|
||||
for (const e of [...active]) {
|
||||
if (!e.node.isConnected || !e.node.nodeValue?.includes(SIG_PREFIX)) {
|
||||
if (!e.node.isConnected || !e.node.nodeValue?.startsWith(SIG_PREFIX, e.start)) {
|
||||
e.wrap.remove();
|
||||
active.delete(e);
|
||||
}
|
||||
|
||||
8
dist/chrome/content.js
vendored
8
dist/chrome/content.js
vendored
File diff suppressed because one or more lines are too long
4
dist/chrome/index.html
vendored
4
dist/chrome/index.html
vendored
@@ -7,14 +7,14 @@
|
||||
<script type="module" crossorigin src="/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/index.css">
|
||||
</head>
|
||||
<body>
|
||||
<body>
|
||||
<div id="overbar"><p>inØsight 3.1.0<span id="sigDetect"></span><a id="homepage" href="https://github.com/inzerosight/inzerosight" target="_blank" rel="noopener">source</a></p></div>
|
||||
<textarea id="textarea" placeholder="input text here..."></textarea>
|
||||
<input id="encodeButton" type="button" name="button" value="encode to clipboard"/>
|
||||
<input id="decodeButton" type="button" name="button" value="decode from text"/>
|
||||
<select id="encoder">
|
||||
<optgroup label="Standard">
|
||||
<option>ZWUS-3</option>
|
||||
<option>ZWUS-3</option>
|
||||
<option selected>ZWUS-6</option>
|
||||
<option>ZWUS-8</option>
|
||||
</optgroup>
|
||||
|
||||
2
dist/chrome/manifest.json
vendored
2
dist/chrome/manifest.json
vendored
@@ -1 +1 @@
|
||||
{"name":"inØsight","version":"3.0.0","author":"planetrenox@pm.me","homepage_url":"https://github.com/inzerosight/inzerosight","description":"Communicate undetected in plain sight.","icons":{"48":"icon_500.png"},"manifest_version":3,"action":{"default_icon":{"48":"icon_500.png"},"default_title":"inØsight","default_popup":"index.html"},"content_scripts":[{"matches":["<all_urls>"],"js":["content.js"],"run_at":"document_idle"}]}
|
||||
{"name":"inØsight","version":"3.1.0","author":"planetrenox@pm.me","homepage_url":"https://github.com/inzerosight/inzerosight","description":"Communicate undetected in plain sight.","icons":{"48":"icon_500.png"},"manifest_version":3,"action":{"default_icon":{"48":"icon_500.png"},"default_title":"inØsight","default_popup":"index.html"},"content_scripts":[{"matches":["<all_urls>"],"js":["content.js"],"run_at":"document_idle"}]}
|
||||
8
dist/firefox/content.js
vendored
8
dist/firefox/content.js
vendored
File diff suppressed because one or more lines are too long
4
dist/firefox/index.html
vendored
4
dist/firefox/index.html
vendored
@@ -7,14 +7,14 @@
|
||||
<script type="module" crossorigin src="/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/index.css">
|
||||
</head>
|
||||
<body>
|
||||
<body>
|
||||
<div id="overbar"><p>inØsight 3.1.0<span id="sigDetect"></span><a id="homepage" href="https://github.com/inzerosight/inzerosight" target="_blank" rel="noopener">source</a></p></div>
|
||||
<textarea id="textarea" placeholder="input text here..."></textarea>
|
||||
<input id="encodeButton" type="button" name="button" value="encode to clipboard"/>
|
||||
<input id="decodeButton" type="button" name="button" value="decode from text"/>
|
||||
<select id="encoder">
|
||||
<optgroup label="Standard">
|
||||
<option>ZWUS-3</option>
|
||||
<option>ZWUS-3</option>
|
||||
<option selected>ZWUS-6</option>
|
||||
<option>ZWUS-8</option>
|
||||
</optgroup>
|
||||
|
||||
2
dist/firefox/manifest.json
vendored
2
dist/firefox/manifest.json
vendored
@@ -1 +1 @@
|
||||
{"name":"inØsight","version":"3.0.0","author":"planetrenox@pm.me","homepage_url":"https://github.com/inzerosight/inzerosight","description":"Communicate undetected in plain sight.","icons":{"48":"icon_500.png"},"manifest_version":2,"browser_action":{"browser_style":false,"default_icon":"icon_500.png","default_title":"inØsight","default_popup":"index.html"},"content_security_policy":"script-src 'self'; style-src 'self';","browser_specific_settings":{"gecko":{"id":"{0a73f41c-c59c-404b-9e07-f7392fa830d4}"}},"content_scripts":[{"matches":["<all_urls>"],"js":["content.js"],"run_at":"document_idle"}]}
|
||||
{"name":"inØsight","version":"3.1.0","author":"planetrenox@pm.me","homepage_url":"https://github.com/inzerosight/inzerosight","description":"Communicate undetected in plain sight.","icons":{"48":"icon_500.png"},"manifest_version":2,"browser_action":{"browser_style":false,"default_icon":"icon_500.png","default_title":"inØsight","default_popup":"index.html"},"content_security_policy":"script-src 'self'; style-src 'self';","browser_specific_settings":{"gecko":{"id":"{0a73f41c-c59c-404b-9e07-f7392fa830d4}"}},"content_scripts":[{"matches":["<all_urls>"],"js":["content.js"],"run_at":"document_idle"}]}
|
||||
BIN
dist/inzerosight-chrome.zip
vendored
BIN
dist/inzerosight-chrome.zip
vendored
Binary file not shown.
BIN
dist/inzerosight-firefox.zip
vendored
BIN
dist/inzerosight-firefox.zip
vendored
Binary file not shown.
4
dist/web/index.html
vendored
4
dist/web/index.html
vendored
@@ -7,14 +7,14 @@
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-DbbumV8Y.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="overbar"><p>inØsight 3.0.0<span id="sigDetect"></span><a id="homepage" href="https://github.com/inzerosight/inzerosight" target="_blank" rel="noopener">source</a></p></div>
|
||||
<div id="overbar"><p>inØsight 3.1.0<span id="sigDetect"></span><a id="homepage" href="https://github.com/inzerosight/inzerosight" target="_blank" rel="noopener">source</a></p></div>
|
||||
<textarea id="textarea" placeholder="input text here..."></textarea>
|
||||
<input id="encodeButton" type="button" name="button" value="encode to clipboard"/>
|
||||
<input id="decodeButton" type="button" name="button" value="decode from text"/>
|
||||
<select id="encoder">
|
||||
<optgroup label="Standard">
|
||||
<option>ZWUS-3</option>
|
||||
<option>ZWUS-6</option>
|
||||
<option selected>ZWUS-6</option>
|
||||
<option>ZWUS-8</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="overbar"><p>inØsight 3.0.0<span id="sigDetect"></span><a id="homepage" href="https://github.com/inzerosight/inzerosight" target="_blank" rel="noopener">source</a></p></div>
|
||||
<div id="overbar"><p>inØsight 3.1.0<span id="sigDetect"></span><a id="homepage" href="https://github.com/inzerosight/inzerosight" target="_blank" rel="noopener">source</a></p></div>
|
||||
<textarea id="textarea" placeholder="input text here..."></textarea>
|
||||
<input id="encodeButton" type="button" name="button" value="encode to clipboard"/>
|
||||
<input id="decodeButton" type="button" name="button" value="decode from text"/>
|
||||
<select id="encoder">
|
||||
<optgroup label="Standard">
|
||||
<option>ZWUS-3</option>
|
||||
<option>ZWUS-6</option>
|
||||
<option selected>ZWUS-6</option>
|
||||
<option>ZWUS-8</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "inzerosight",
|
||||
"version": "3.0.0",
|
||||
"version": "3.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -12,7 +12,7 @@ export default defineConfig(async ({ mode }) => {
|
||||
manifest: () => {
|
||||
const base = {
|
||||
name: "in\u00D8sight",
|
||||
version: "3.0.0",
|
||||
version: "3.1.0",
|
||||
author: "planetrenox@pm.me",
|
||||
homepage_url: "https://github.com/inzerosight/inzerosight",
|
||||
description: "Communicate undetected in plain sight.",
|
||||
|
||||
Reference in New Issue
Block a user