Skip to content
Snippets Groups Projects
Commit bd9755f3 authored by David Byers's avatar David Byers
Browse files

Added debugging output (stripped by build)

parent 0a907e5c
No related branches found
No related tags found
1 merge request!8Beta
Pipeline #33113 passed
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
}, },
"content_scripts": [ "content_scripts": [
{ {
"matches": ["*://outlook.office.com/*"], "matches": [
"*://outlook.office.com/*",
"*://outlook.office365.com/*"
],
"css": [ "css": [
"style.css" "style.css"
], ],
......
...@@ -33,11 +33,13 @@ function mutationHandler(mutationsList, observer) { ...@@ -33,11 +33,13 @@ function mutationHandler(mutationsList, observer) {
let contentNode = (document.getElementById('divRplyFwdMsg') let contentNode = (document.getElementById('divRplyFwdMsg')
|| document.getElementById('x_divRplyFwdMsg'))?.nextElementSibling; || document.getElementById('x_divRplyFwdMsg'))?.nextElementSibling;
console.log('enter mutationHandler'); // DEBUG
while (contentNode) { while (contentNode) {
removeAllTheLinks(contentNode); removeAllTheLinks(contentNode);
contentNode = contentNode.nextElementSibling; contentNode = contentNode.nextElementSibling;
} }
fixAllTheLinks(document.body); fixAllTheLinks(document.body);
console.log('exit mutationHandler'); // DEBUG
} }
......
...@@ -21,6 +21,10 @@ for target in "${TARGETS[@]}" ; do ...@@ -21,6 +21,10 @@ for target in "${TARGETS[@]}" ; do
cp -r "$sourcedir"/* "$targetdir" cp -r "$sourcedir"/* "$targetdir"
rm "$targetdir"/manifest.part.json rm "$targetdir"/manifest.part.json
for file in "$targetdir"/*.js ; do
sed -i -e '/\/\/ DEBUG$/d' "$file"
done
python3 "$BASEDIR/scripts/makemanifest.py" \ python3 "$BASEDIR/scripts/makemanifest.py" \
"$SHAREDDIR/manifest.part.json" \ "$SHAREDDIR/manifest.part.json" \
"$sourcedir/manifest.part.json" \ "$sourcedir/manifest.part.json" \
......
...@@ -103,7 +103,9 @@ function getTextNodes(elem) { ...@@ -103,7 +103,9 @@ function getTextNodes(elem) {
* @param {Element} root - DOM element in which to fix links. * @param {Element} root - DOM element in which to fix links.
*/ */
function fixAllTheLinks(root) { function fixAllTheLinks(root) {
console.log('enter fixAllTheLinks'); // DEBUG
for (const link of root.getElementsByTagName('a')) { for (const link of root.getElementsByTagName('a')) {
console.log(link); // DEBUG
if (link.href) { if (link.href) {
// Untangle link text // Untangle link text
for (const node of getTextNodes(link)) { for (const node of getTextNodes(link)) {
...@@ -116,6 +118,7 @@ function fixAllTheLinks(root) { ...@@ -116,6 +118,7 @@ function fixAllTheLinks(root) {
} }
} }
} }
console.log('exit fixAllTheLinks'); // DEBUG
} }
...@@ -124,7 +127,9 @@ function fixAllTheLinks(root) { ...@@ -124,7 +127,9 @@ function fixAllTheLinks(root) {
* @param {Element} root - DOM element in which to fix links. * @param {Element} root - DOM element in which to fix links.
*/ */
function removeAllTheLinks(root) { function removeAllTheLinks(root) {
console.log('enter removeAllTheLinks'); // DEBUG
for (const link of root.getElementsByTagName('a')) { for (const link of root.getElementsByTagName('a')) {
console.log(link); // DEBUG
if (isTangledLink(link.href)) { if (isTangledLink(link.href)) {
link.href = untangleLink(link.href); link.href = untangleLink(link.href);
} }
...@@ -132,4 +137,5 @@ function removeAllTheLinks(root) { ...@@ -132,4 +137,5 @@ function removeAllTheLinks(root) {
for (const textNode of getTextNodes(root)) { for (const textNode of getTextNodes(root)) {
textNode.textContent = untangleLink(textNode.textContent); textNode.textContent = untangleLink(textNode.textContent);
} }
console.log('exit removeAllTheLinks'); // DEBUG
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment