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) ...@@ -68,6 +68,12 @@ reloadRegistryFromStorage(registry)
function onObservedTabUpdated(tabId: number): void { function onObservedTabUpdated(tabId: number): void {
let observation = resolveObservationsForTab(allObservations, tabId); let observation = resolveObservationsForTab(allObservations, tabId);
if (hasDetectedData(observation)) { if (hasDetectedData(observation)) {
if (observation.preemptable) {
chrome.pageAction.setPopup({
tabId: tabId,
popup: chrome.extension.getURL("popup/index.html")
});
}
chrome.pageAction.show(tabId); chrome.pageAction.show(tabId);
} else { } else {
chrome.pageAction.hide(tabId); chrome.pageAction.hide(tabId);
...@@ -187,12 +193,6 @@ function onHeadersReceived( ...@@ -187,12 +193,6 @@ function onHeadersReceived(
// modify header // modify header
let headers = details.responseHeaders; let headers = details.responseHeaders;
setHeader(headers, "Content-Type", "text/plain"); 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 }; return { responseHeaders: headers };
} }
// if there are still nothing, try to probe with HTTP content negotiation // 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