Commit fff06cb4 by ramdayalmunda

extension overlapping on skikkum

parent 9302afe2
var getUserDetails = null var getUserDetails = null
!function () { !function () {
var origin = "http://localhost:3039" var origin = "https://begenieus.online"
var tutorShotId = null var tutorShotId = null
var imageNumber = 0; var imageNumber = 0;
var recording = false; var recording = false;
......
...@@ -5,40 +5,27 @@ var loggedIn = false; ...@@ -5,40 +5,27 @@ var loggedIn = false;
var floatingBar = null; var floatingBar = null;
var startingOverlay = null; var startingOverlay = null;
var overlayInterval = null; var overlayInterval = null;
const origin = "http://localhost:3039" const origin = "https://begenieus.online"
var userDetails = {}; var userDetails = {};
var btn = {}; var btn = {};
var tutorShotOid = null; var tutorShotOid = null;
var containerDiv; var containerDiv;
var sr; var sr;
var hitNumber = new Date().getTime()
var webpageObserver = { disconnect(){} } var webpageObserver = { disconnect(){} }
!(async function () { !(async function () {
if (window.origin == origin){ login() } if (window.origin == origin){ login() }
else{ else{
window.clearInterval( window.tutorShotInterval )
webpageObserver.disconnect()
let body = document.querySelector('body') window.tutorShotInterval = setInterval( async ()=>{
webpageObserver = new MutationObserver(mutations => { try{
mutations.forEach(async (mutation) => { let data = await getCaptureData()
if (mutation.type === 'childList' && mutation.target === body) { reRenderFloatingBar(data)
const addedNodes = mutation.addedNodes; }catch(err){
const removedNodes = mutation.removedNodes; console.log(err)
}
if (addedNodes.length || removedNodes.length) { }, 1000 )
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')
...@@ -412,7 +399,11 @@ chrome.runtime.onMessage.addListener(async function (message, sender, sendRespon ...@@ -412,7 +399,11 @@ chrome.runtime.onMessage.addListener(async function (message, sender, sendRespon
reRenderFloatingBar(data) reRenderFloatingBar(data)
} }
else if (message.message == 'recordingStopped') { else if (message.message == 'recordingStopped') {
window.open(`${origin}/tutor-shot-list`) if (window.location.href == `${origin}/tutor-shot-list`){
window.location.reload()
}else {
window.open(`${origin}/tutor-shot-list`)
}
} }
}); });
......
{ {
"manifest_version": 3, "manifest_version": 3,
"name": "Tutor Shot Local", "name": "Tutor Shot Local",
"version": "1.4", "version": "1.7",
"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 https://begenieus.online.",
"permissions": [ "permissions": [
"activeTab", "activeTab",
"storage" "storage"
......
!function () { !function () {
const origin = "http://localhost:3039" const origin = "https://begenieus.online"
const api = axios.create({ const api = axios.create({
baseURL: `${origin}/api`, // the base URL for nodeserver is okay but NGINX is giving error baseURL: `${origin}/api`, // the base URL for nodeserver is okay but NGINX is giving error
......
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