Skip to content

Commit

Permalink
feat: use the new custom column API for TB 115+
Browse files Browse the repository at this point in the history
* Update for TB128 + Custom Columns

* Use better name
  • Loading branch information
jobisoft authored Jul 24, 2024
1 parent 477aa3a commit 546f9e3
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 320 deletions.
8 changes: 4 additions & 4 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"manifest_version": 2,
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "1.4.2",
"version": "1.5.0",
"author": "Christian Zaenker",
"default_locale": "en",
"applications": {
"gecko": {
"id": "spamscores@czaenker",
"strict_min_version": "91.0a1",
"strict_max_version": "115.*"
"strict_min_version": "115.0",
"strict_max_version": "128.*"
}
},
"icons": {
Expand All @@ -23,7 +23,7 @@
"permissions": ["messagesRead", "accountsRead", "storage"],
"experiment_apis": {
"SpamScores": {
"schema": "schema.json",
"schema": "src/experiments/schema.json",
"parent": {
"scopes": ["addon_parent"],
"paths": [["SpamScores"]],
Expand Down
33 changes: 1 addition & 32 deletions src/background/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,33 +116,6 @@ async function onMessageDisplayed(tab, message) {
}
}

/**
* Fired when the selected messages change in any mail tab.
* @param {Tab} tab
* @param {MessageList} selectedMessages
*/
async function onSelectedMessagesChanged(tab, selectedMessages) {
const spamScores = messenger.SpamScores
const win = await messenger.windows.getCurrent()
spamScores.repaint(win.id)
}

/**
* Fired when the displayed folder changes in any mail tab
* @param {Tab} tab
* @param {MailFolder} displayedFolder
*/
async function onDisplayedFolderChanged(tab, displayedFolder) {
const spamScores = messenger.SpamScores
// Disable addon on root folder
if (displayedFolder.path !== '/') {
const win = await messenger.windows.getCurrent()
spamScores.repaint(win.id)
} else {
// Cleans in case we go to root
spamScores.clear()
}
}
/**
* Main
*/
Expand Down Expand Up @@ -179,11 +152,6 @@ const init = async () => {

// Add Listeners
messenger.messageDisplay.onMessageDisplayed.addListener(onMessageDisplayed)
messenger.mailTabs.onDisplayedFolderChanged.addListener(onDisplayedFolderChanged)
messenger.mailTabs.onSelectedMessagesChanged.addListener(onSelectedMessagesChanged)

const win = await messenger.windows.getCurrent()
spamScores.repaint(win.id)

// Init Data
const [lowerBounds, upperBounds] = getBounds(storage)
Expand All @@ -197,5 +165,6 @@ const init = async () => {
storage.hideIconScoreNeutral || false,
storage.hideIconScoreNegative || false
)
spamScores.addColumns("SpamScore", "SpamScore (Icon)");
}
init()
12 changes: 0 additions & 12 deletions src/experiments/custom_score_column.css

This file was deleted.

223 changes: 0 additions & 223 deletions src/experiments/custom_score_column.js

This file was deleted.

Loading

0 comments on commit 546f9e3

Please sign in to comment.