mirror of
https://github.com/jonroig/MailtOWA.git
synced 2026-04-25 09:05:54 +03:00
[GH-ISSUE #10] Original 'mailto' handler not called, if owaIntercept == "off" #6
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/MailtOWA-jonroig#6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kriegaex on GitHub (Jun 19, 2022).
Original GitHub issue: https://github.com/jonroig/MailtOWA/issues/10
This code is always executed for
mailto:links:github.com/jonroig/MailtOWA@60caaab443/mailtowa.js (L18-L21)Fetching the config value from
chrome.storage.syncis inherently asynchronous, so I know it is difficult to fetch the config value and use it in a condition skipping those lines of code, if the user setting is"off", but this could be fixed by caching the configuration locally, also making sure that the cache is getting refreshed, using an event handler reacting to changes inchrome.storage.sync. I do not speak JS at all, but I think this is the way you handle such things in a language like this, trying to escape the infamous callback hell.@kriegaex commented on GitHub (Jun 19, 2022):
Disclaimer: In my fork, I modified the extension to fit my needs for another type of web mailer. This is my very first try to write or modify any JS code, so probably the code is horrible. Of course, I also never wrote a Chrome extension.
You may want to refer to my content script in order to see how I am using
localStorageas a cache forchrome.storage.sync. Maybe you want to do something similar. In my case, it solves the problem.