Commit d7330a80 by ramdayalmunda

flikering after turor shot is active and switched to new pages

parent f73b468d
...@@ -22,20 +22,6 @@ var sr; ...@@ -22,20 +22,6 @@ var sr;
containerDiv.style.width = "0px" containerDiv.style.width = "0px"
containerDiv.style.height = "0px" containerDiv.style.height = "0px"
containerDiv.style.zIndex = "9999" containerDiv.style.zIndex = "9999"
document.body.append(containerDiv)
const observer = new MutationObserver(async function (mutationsList, observer) {
for (let mutation of mutationsList) {
if (mutation.type === 'childList' && mutation.removedNodes.length > 0) {
if ([...mutation.removedNodes].includes(containerDiv)) {
console.log('The target node has been removed from the DOM.');
let data = await getCaptureData()
reRenderFloatingBar(data)
}
}
}
});
observer.observe(document.body, { childList: true })
sr = containerDiv.attachShadow({ mode: 'open' }); sr = containerDiv.attachShadow({ mode: 'open' });
...@@ -343,11 +329,13 @@ window.addEventListener('mousedown', async function (e) { ...@@ -343,11 +329,13 @@ window.addEventListener('mousedown', async function (e) {
width: document.body.clientWidth, width: document.body.clientWidth,
}, },
tagName: e.target.tagName, tagName: e.target.tagName,
outerText: e.target.outerText, text: e.target.innerText,
interText: e.target.interText,
url: location.href, url: location.href,
origin: location.origin, origin: location.origin,
} }
let newLineBreakIndex = captureInfo.text.search( '\n' )
if (newLineBreakIndex!=-1) captureInfo.text = captureInfo.text.slice(0, newLineBreakIndex)
// console.log('sending capture info', captureInfo)
chrome.runtime.sendMessage({ action: "captureSS", captureInfo }) chrome.runtime.sendMessage({ action: "captureSS", captureInfo })
let data = await getCaptureData() let data = await getCaptureData()
reRenderFloatingBar(data) reRenderFloatingBar(data)
......
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