Commit 1d2d3bba authored by Adrien Dorsaz's avatar Adrien Dorsaz

Initial commit: while addreBooks.list() doesn't return new Address Books, it can't work

parents
Pipeline #222 failed with stages
# EditorConfig: http://EditorConfig.org
# top-most EditorConfig file
root = true
# For all files
# - Unix EOF
# - Keep an empty line at end of files
# - charset is UTF-8
# - indetation is made of 4 spaces
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
# Makefile requires tabs for indentation
[Makefile]
indent_style = tab
This diff is collapsed.
webexchange allows you to get data from Exchange Web Services into
your Thunderbird mail client.
Copyright ⓒ 2018 Adrien Dorsaz <adrien@adorsaz.ch>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
{
"extensionName": {
"description": "Name of the extension.",
"message": "Web Exchange"
},
"extensionDescription": {
"description": "Description of the extension (less than 250 characters).",
"message": "Get data from Exchange Web Services into Thunderbird."
}
}
{
"manifest_version": 2,
"name": "__MSG_extensionName__",
"version": "1.0",
"author": "Adrien Dorsaz",
"homepage_url": "https://projects.adorsaz.ch/adrien/webexchange",
"default_locale": "en",
"description": "__MSG_extensionDescription__",
"permissions": ["addressBooks"],
"options_ui": {
"browser_style": true,
"open_in_tab": false,
"page": "src/options/options.html"
},
"background": {
"scripts": [
"src/addressbook/directory.js"
]
}
}
browser.addressBooks.list()
.then(
(ABList) =>
{
for (let addressbook of ABList)
{
console.log("Found address book: " + addressbook.name);
}
let ABWebExchange = ABList.find(
(addressbook) => {
return (addressbook.name === "Web Exchange");
}
);
if (!ABWebExchange)
{
browser.addressBooks.create({name: "Web Exchange"});
}
browser.addressBooks.list()
.then(
(ABList2) => {
for (let addressbook of ABList2)
{
console.log("Found address book: " + addressbook.name);
}
let ABWebExchange = ABList2.find(
(addressbook) => {
return (addressbook.name === "Web Exchange");
}
);
if (!ABWebExchange)
{
throw "WebExchange: unable to create Web Exchange main addressbook."
}
},
(ABError) => {
throw "WebExchange: unable to list addressbooks (after tried to add one): " + ABError
}
);
},
(ABError) =>
{
throw "WebExchange: unable to list addressbooks: " + ABError
}
);
<html>
<head>
<title>Web Exchange</title>
</head>
<body>
<h1>Web Exchange</h1>
<p>When we'll provide you settings, you'll find them here</p>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment