Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
SemWeb
libview
Commits
37b7ad078b2a
Commit
f22d44fa
authored
Jul 06, 2018
by
Laurent Wouters
Browse files
Transform into a web extension
parent
6c4152a85ccb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/background/main.js
View file @
37b7ad07
...
...
@@ -3,7 +3,8 @@ var allTabs = {};
function
getTabData
(
id
)
{
if
(
!
allTabs
.
hasOwnProperty
(
id
))
{
allTabs
[
id
]
=
{
isActive
:
false
isActive
:
false
,
hasData
:
""
};
}
return
allTabs
[
id
];
...
...
@@ -19,6 +20,14 @@ function updateIcon(tabId) {
},
tabId
:
tabId
});
chrome
.
browserAction
.
setBadgeBackgroundColor
({
color
:
[
217
,
0
,
0
,
255
],
tabId
:
tabId
});
chrome
.
browserAction
.
setBadgeText
({
text
:
data
.
hasData
,
tabId
:
tabId
});
}
function
toggleActive
(
tab
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment