Commit c7c86561 authored by Laurent Wouters's avatar Laurent Wouters
Browse files

[fix] Fixed display of popup on preempted tabs

parent 7f8d05abbe8b
......@@ -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
......
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