-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MOD: Extracted access to Border Color's api into a javascript module.
- Loading branch information
1 parent
4520dcd
commit 9819194
Showing
3 changed files
with
29 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const EXTENSION_ID = "bordercolors-d@addonsdev.mozilla.org"; | ||
|
||
export class BorderColorsApi { | ||
constructor() { | ||
|
||
} | ||
|
||
async getAllColors() { | ||
let borderColors = null; | ||
try { | ||
let resp = await browser.runtime.sendMessage(EXTENSION_ID, | ||
{command: "colors.all"}); | ||
if(resp) { | ||
borderColors = resp; | ||
} | ||
} catch(error) { | ||
// Border Colores not installed or otherwise available; eat the | ||
// exception | ||
} | ||
|
||
return borderColors; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters