Comments (6)
In fact it should be possible setting the timer in the background.js, but only if you find a way to call the reprocessing function from outside the Vue instance... I didn't look into that yet, but I'll see what I can do.
from third-stats.
Referencing here findings & summary notes (with links and quotes in context) of ~2 hours of research re Thunderbird and Timers. Hope it saves you some time :)
tldr appears to be:
- nsItimer
- setTimeout()
- Experiments API ( + wrappers)
Search: nsITimer
(is XPCOM)
AdBlockPlus Issue 7375 - Replace Ci.nsITimer with setTimeout()
TorBrowser: Investigate new WebExtensions API requirements for our extensions
WA7: Timers: Current Solution: nsITimer with TYPE_ONE_SHOT New Solution: window.setTimeout(). Also look at chrome.alarms.*
Search setTimeout
- https://developer.mozilla.org/en-US/docs/Web/API/setTimeout
- https://developer.thunderbird.net/add-ons/mailextensions#webextension-scripts
Web API (if the browser compatibility chart lists Firefox, the API also works in Thunderbird)
- https://developer.thunderbird.net/add-ons/mailextensions#experiment-apis
- https://developer.thunderbird.net/add-ons/mailextensions/supported-webextension-api
As Thunderbird is based on Firefox, many of its WebExtension APIs
Search idle
[x] Automatic thirdstats processing
[x] Only when idle (or locked)
Thunderbird 102 supporting addon: Quick Folders
QuickFolders apparently supports 102 (issue above is performance issue on 102)
Update-Info from Mozilla: Version 102.2.2, first offered to channel users on September 7, 2022
fixed: Accessing mail folders in profiles with many folders was slow
QuickFolders uses Timers (WindowListener/*
& setTimeout
(in quickfolders-interface.js
)"
- Code results: https://github.com/RealRaven2000/QuickFolders/search?q=timer
- chrome/content/api/WindowListener/implementation.js
- https://github.com/RealRaven2000/QuickFolders/blob/master/chrome/content/api/WindowListener/implementation.js#L280
...
// async sleep function using Promise
async sleep(delay) {
let timer = Components.classes["@mozilla.org/timer;1"].createInstance(
Components.interfaces.nsITimer
...
Components.interfaces.nsITimer.TYPE_ONE_SHOT
WindowListener
from https://github.com/thundernest/addon-developer-support- https://github.com/thundernest/addon-developer-support/wiki/Using-the-WindowListener-API-to-convert-a-Legacy-Overlay-WebExtension-into-a-MailExtension-for-Thunderbird-78
- https://github.com/thundernest/addon-developer-support/blob/master/wrapper-apis/WindowListener/implementation.js
The WindowListener API may only be called from the background page.
from third-stats.
Wow thanks! I'll look into that.
from third-stats.
Thinking about it more, and how the value of thirdstats is likely proportional to mail store size, I'm going to up my recommended default time to 24 hours (once a day).
from third-stats.
The automatic background processing is a timer which starts when opening the stats page and is only active as long as the stats page is open. So 24h means you'd have to have your stats page open 24h.
Given that, I think 6h is just fine to reprocess the data at least once on a working day.
from third-stats.
The automatic background processing is a timer which starts when opening the stats page
Not possible to register a timer on extension load/init, independent of whether stats is open or not?
from third-stats.
Related Issues (20)
- Exclude folders from stats
- Never got to a result HOT 30
- Option to sync ThirdStats theme with Thunderbird theme HOT 4
- Copy email addresses to clipboard from charts showing contacts HOT 3
- Processing for account with 150k emails is stuck HOT 2
- Matrix charts are misaligned HOT 1
- Make primary colors customisable
- Add-on option to process folders in filter recursively HOT 3
- Visualize contacts as network graph HOT 1
- Option to disable instant processing
- ThirdStats counts are always incorrect HOT 6
- Performance tests with query() instead of list() HOT 1
- Identities Management HOT 2
- Only count initial email (ignore replies)
- Clean options page
- Filter option for subject substrings HOT 4
- Migrate from Stylus to Tailwindcss
- Migrate to Pinia stores
- Tags are not showing properly HOT 2
- Semantic analysis features for fun and elucidation. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from third-stats.