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
858d9c5522df
Commit
c7c86561
authored
Sep 27, 2018
by
Laurent Wouters
Browse files
[fix] Fixed display of popup on preempted tabs
parent
7f8d05abbe8b
Changes
1
Hide whitespace changes
Inline
Side-by-side
extension/src/background/main.ts
View file @
858d9c55
...
...
@@ -68,6 +68,12 @@ reloadRegistryFromStorage(registry)
function
onObservedTabUpdated
(
tabId
:
number
):
void
{
let
observation
=
resolveObservationsForTab
(
allObservations
,
tabId
);
if
(
hasDetectedData
(
observation
))
{
if
(
observation
.
preemptable
)
{
chrome
.
pageAction
.
setPopup
({
tabId
:
tabId
,
popup
:
chrome
.
extension
.
getURL
(
"
popup/index.html
"
)
});
}
chrome
.
pageAction
.
show
(
tabId
);
}
else
{
chrome
.
pageAction
.
hide
(
tabId
);
...
...
@@ -187,12 +193,6 @@ function onHeadersReceived(
// modify header
let
headers
=
details
.
responseHeaders
;
setHeader
(
headers
,
"
Content-Type
"
,
"
text/plain
"
);
// set the popup
chrome
.
pageAction
.
setPopup
({
tabId
:
details
.
tabId
,
popup
:
chrome
.
extension
.
getURL
(
"
popup/index.html
"
)
});
chrome
.
pageAction
.
show
(
details
.
tabId
);
return
{
responseHeaders
:
headers
};
}
// if there are still nothing, try to probe with HTTP content negotiation
...
...
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