Commit 8993e028 authored by Laurent Wouters's avatar Laurent Wouters
Browse files

[fix] Fixed the incorrect reuse of observation objects across tabs

parent f0e402b535f6
...@@ -330,7 +330,7 @@ chrome.pageAction.onClicked.addListener((tab: chrome.tabs.Tab) => { ...@@ -330,7 +330,7 @@ chrome.pageAction.onClicked.addListener((tab: chrome.tabs.Tab) => {
// a dataset can be obtained through HTTP content negotiation // a dataset can be obtained through HTTP content negotiation
// => open a new tab with the same observations // => open a new tab with the same observations
let callback = (openedTab: chrome.tabs.Tab) => { let callback = (openedTab: chrome.tabs.Tab) => {
allObservations[openedTab.id] = observation; allObservations[openedTab.id] = JSON.parse(JSON.stringify(observation));
chrome.pageAction.setPopup({ chrome.pageAction.setPopup({
tabId: openedTab.id, tabId: openedTab.id,
popup: chrome.extension.getURL("popup/index.html") popup: chrome.extension.getURL("popup/index.html")
...@@ -357,7 +357,7 @@ chrome.pageAction.onClicked.addListener((tab: chrome.tabs.Tab) => { ...@@ -357,7 +357,7 @@ chrome.pageAction.onClicked.addListener((tab: chrome.tabs.Tab) => {
"ldbrowser/index.html?target=" + encodeURIComponent(observation.url) "ldbrowser/index.html?target=" + encodeURIComponent(observation.url)
); );
let callback = (openedTab: chrome.tabs.Tab) => { let callback = (openedTab: chrome.tabs.Tab) => {
allObservations[openedTab.id] = observation; allObservations[openedTab.id] = JSON.parse(JSON.stringify(observation));
}; };
let promise: any = chrome.tabs.create( let promise: any = chrome.tabs.create(
{ {
......
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