Commit a04c153d by ramdayalmunda

stikkum issue

parent d7330a80
...@@ -11,9 +11,35 @@ var btn = {}; ...@@ -11,9 +11,35 @@ var btn = {};
var tutorShotOid = null; var tutorShotOid = null;
var containerDiv; var containerDiv;
var sr; var sr;
var hitNumber = new Date().getTime()
var webpageObserver = { disconnect(){} }
!(async function () { !(async function () {
if (window.origin == origin) login() if (window.origin == origin){ login() }
else{
webpageObserver.disconnect()
let body = document.querySelector('body')
webpageObserver = new MutationObserver(mutations => {
mutations.forEach(async (mutation) => {
if (mutation.type === 'childList' && mutation.target === body) {
const addedNodes = mutation.addedNodes;
const removedNodes = mutation.removedNodes;
if (addedNodes.length || removedNodes.length) {
let newHit = new Date().getTime()
if (newHit-hitNumber>800){
let data = await getCaptureData()
reRenderFloatingBar(data)
hitNumber = newHit
}
}
}
});
});
const config = { childList: true, subtree: false };
webpageObserver.observe(body, config);
}
containerDiv = document.createElement('div') containerDiv = document.createElement('div')
containerDiv.style.position = "fixed" containerDiv.style.position = "fixed"
......
{ {
"manifest_version": 3, "manifest_version": 3,
"name": "Tutor Shot Local", "name": "Tutor Shot Test",
"version": "1.2", "version": "1.4",
"description": "Capture web-page screenshots instantly with a single click. They're saved to your account at http://localhost:3039.", "description": "Capture web-page screenshots instantly with a single click. They're saved to your account at http://localhost:3039.",
"permissions": [ "permissions": [
"activeTab", "activeTab",
......
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