moisseev / rspamd-spamness

Thunderbird add-on for visualizing rspamd spam scores.
BSD 3-Clause "New" or "Revised" License
54 stars 13 forks source link

Headers not showing in TB 115 #34

Open lingfish opened 1 year ago

lingfish commented 1 year ago

Hi, I'm not seeing spam headers in the message pane.

Preference is set right:

image

I'm seeing this in the error console:

TypeError: libExperiments.getDocumentByTabIndex is not a function
[spamHeaders.js:24:45](jar:file:///home/user/.thunderbird/profile/extensions/rspamd-spamness@alexander.moisseev.xpi!/experiments/spamHeaders.js)
TypeError: libExperiments.getDocumentByTabIndex is not a function
[spamHeaders.js:278:53](jar:file:///home/user/.thunderbird/profile/extensions/rspamd-spamness@alexander.moisseev.xpi!/experiments/spamHeaders.js)
TypeError: libExperiments.getDocumentByTabIndex is not a function
8 [spamHeaders.js:289:53](jar:file:///home/user/.thunderbird/profile/extensions/rspamd-spamness@alexander.moisseev.xpi!/experiments/spamHeaders.js)
TypeError: libExperiments.getDocumentByTabIndex is not a function
[spamHeaders.js:242:53](jar:file:///home/user/.thunderbird/profile/extensions/rspamd-spamness@alexander.moisseev.xpi!/experiments/spamHeaders.js)
TypeError: libExperiments.getDocumentByTabIndex is not a function
16 [spamHeaders.js:209:53](jar:file:///home/user/.thunderbird/profile/extensions/rspamd-spamness@alexander.moisseev.xpi!/experiments/spamHeaders.js)
TypeError: libExperiments.getDocumentByTabIndex is not a function
[spamHeaders.js:278:53](jar:file:///home/user/.thunderbird/profile/extensions/rspamd-spamness@alexander.moisseev.xpi!/experiments/spamHeaders.js)
libExperiments.getDocumentByTabIndex is not a function [popup.js:69](jar:file:///home/user/.thunderbird/profile/extensions/rspamd-spamness@alexander.moisseev.xpi!/experiments/popup.js)
TypeError: libExperiments.getDocumentByTabIndex is not a function
[spamHeaders.js:24:45](jar:file:///home/user/.thunderbird/profile/extensions/rspamd-spamness@alexander.moisseev.xpi!/experiments/spamHeaders.js)
TypeError: libExperiments.getDocumentByTabIndex is not a function
[spamHeaders.js:278:53](jar:file:///home/user/.thunderbird/profile/extensions/rspamd-spamness@alexander.moisseev.xpi!/experiments/spamHeaders.js)
TypeError: libExperiments.getDocumentByTabIndex is not a function
8 [spamHeaders.js:289:53](jar:file:///home/user/.thunderbird/profile/extensions/rspamd-spamness@alexander.moisseev.xpi!/experiments/spamHeaders.js)
TypeError: libExperiments.getDocumentByTabIndex is not a function
[spamHeaders.js:242:53](jar:file:///home/user/.thunderbird/profile/extensions/rspamd-spamness@alexander.moisseev.xpi!/experiments/spamHeaders.js)
TypeError: libExperiments.getDocumentByTabIndex is not a function
16 [spamHeaders.js:209:53](jar:file:///home/user/.thunderbird/profile/extensions/rspamd-spamness@alexander.moisseev.xpi!/experiments/spamHeaders.js)
TypeError: libExperiments.getDocumentByTabIndex is not a function
moisseev commented 1 year ago

I cannot reproduce the issue. What is your add-on and exact Thunderbird versions?

lingfish commented 1 year ago

Name Thunderbird Version 115.3.1 Build ID 20230928194049

Addon:

Version 2.0.0a15 Last Updated 23 October 2023

This is what I see:

image

moisseev commented 1 year ago

Could it be something to do with OS specific package build particularities?

lingfish commented 1 year ago

Not sure how to troubleshoot that for you. I'm on Debian bookworm. I actually just downgraded back to 102.15, 115 is quite the eyesore for me. Still want to try to fix the issue though.

The log referencing libExperiments.getDocumentByTabIndex doesn't help?

moisseev commented 1 year ago

It looks like the libExperiments.js library is missing or not loaded.

You can add some logging to see what's happening. Here:

https://github.com/moisseev/rspamd-spamness/blob/fa5dc2cbc3c2577f988f72fead040e69569399f1/experiments/libExperiments.js#L20-L25

diff --git a/experiments/libExperiments.js b/experiments/libExperiments.js
index 675b552..67fb77f 100644
--- a/experiments/libExperiments.js
+++ b/experiments/libExperiments.js
@@ -19,7 +19,9 @@ libExperiments.getContentWindow = function (window, tabIndex) {
     throw Error("Could not find the XUL <browser> object");
 };

+console.log("loading");
 libExperiments.getDocumentByTabIndex = function (windowId, tabIndex) {
+    console.log(windowId, tabIndex);
     const window = Services.wm.getOuterWindowWithId(windowId);
     return libExperiments.getContentWindow(window, tabIndex).document;
 };