var frame = document.createElement('iframe'); frame.setAttribute("id", 'trova-frame'+ '0c501815f87e535c740ce9f22cba7cc1'); frame.setAttribute("allow","camera;microphone;"); frame.setAttribute("class","trova-chat-iframe"); frame.setAttribute("style","display:none"); var innerHTMLhttps0c501815f87e535c740ce9f22cba7cc1 = '\ \ \ \ \ \ \ \ \
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
'; var bodytag = document.getElementsByTagName("body")[0]; bodytag.appendChild(frame); var divmain = document.createElement('div'); divmain.setAttribute("class", 'trova-div'); divmain.setAttribute("id", 'trova-div'+ '0c501815f87e535c740ce9f22cba7cc1'); divmain.style.display = "block"; divmain.style.position = "absolute"; var innerUIHTMLhttps0c501815f87e535c740ce9f22cba7cc1 =''; divmain.innerHTML = innerUIHTMLhttps0c501815f87e535c740ce9f22cba7cc1; bodytag.appendChild(divmain); var head = document.getElementsByTagName('head')[0]; var script= document.createElement('script'); script.type = 'text/javascript'; script.charset = 'utf-8'; script.onload = function () { console.log('The script is loaded'); } script.innerHTML = '\ function bindEvent(element, eventName, eventHandler) {\ if (element.addEventListener){\ element.addEventListener(eventName, eventHandler, false);\ } else if (element.attachEvent) {\ element.attachEvent("on" + eventName, eventHandler);\ }\ }\ bindEvent(window, "message", function (e) {\ var iframe0c501815f87e535c740ce9f22cba7cc1 = document.getElementById("trova-frame0c501815f87e535c740ce9f22cba7cc1");\ switch(e.data.event){\ case "hideiframeshowmin":\ if(iframe0c501815f87e535c740ce9f22cba7cc1 != null){\ /*var iframeDoc0c501815f87e535c740ce9f22cba7cc1 = iframe0c501815f87e535c740ce9f22cba7cc1.contentDocument || iframe0c501815f87e535c740ce9f22cba7cc1.contentWindow.document;\ if ( iframeDoc0c501815f87e535c740ce9f22cba7cc1 != null && iframeDoc0c501815f87e535c740ce9f22cba7cc1.readyState == "complete" ) {\ }*/\ iframe0c501815f87e535c740ce9f22cba7cc1.style.display="none";\ document.getElementById("trova-togglegadgetbtn").style.display="flex";\ }\ break;\ case "showiframehidemin":\ if(iframe0c501815f87e535c740ce9f22cba7cc1 != null){\ /*var iframeDoc0c501815f87e535c740ce9f22cba7cc1 = iframe0c501815f87e535c740ce9f22cba7cc1.contentDocument || iframe0c501815f87e535c740ce9f22cba7cc1.contentWindow.document;\ if ( iframeDoc0c501815f87e535c740ce9f22cba7cc1 != null && iframeDoc0c501815f87e535c740ce9f22cba7cc1.readyState == "complete" ) {\ }*/\ iframe0c501815f87e535c740ce9f22cba7cc1.style.display="block";\ }\ document.getElementById("trova-togglegadgetbtn").style.display="none";\ break;\ case "installScreensharePlugIn":\ chrome.webstore.install("",function(e){});\ break;\ case "attachLink":\ var head = document.getElementsByTagName("head")[0];\ var link = document.createElement("link");\ link.rel = "chrome-webstore-item";\ link.href = "https://chrome.google.com/webstore/detail/"+e.data.trovaWidgetScreenShareId;\ head.appendChild(link);\ break;\ case "checkChromeRuntime":\ chrome.runtime.sendMessage(e.data.trovaWidgetScreenShareId, { getVersion: true }, function (response) {\ if(iframe0c501815f87e535c740ce9f22cba7cc1 != null){\ var iframeDoc0c501815f87e535c740ce9f22cba7cc1 = iframe0c501815f87e535c740ce9f22cba7cc1.contentDocument || iframe0c501815f87e535c740ce9f22cba7cc1.contentWindow.document;\ if ( iframeDoc0c501815f87e535c740ce9f22cba7cc1 != null && iframeDoc0c501815f87e535c740ce9f22cba7cc1.readyState == "complete" ) {\ var trovadiv = iframeDoc0c501815f87e535c740ce9f22cba7cc1.getElementById("trova-div0c501815f87e535c740ce9f22cba7cc1");\ if(trovadiv != null)\ {\ if ( document != null && document.readyState == "complete" ) {\ if (!response || !response.version) {\ iframe0c501815f87e535c740ce9f22cba7cc1.contentWindow.showinstallview();\ }else{\ iframe0c501815f87e535c740ce9f22cba7cc1.contentWindow.startscreensharefromframe();\ }\ }\ }\ }\ }\ });\ break;\ case "showfullscreen":\ if(iframe0c501815f87e535c740ce9f22cba7cc1 != null){\ iframe0c501815f87e535c740ce9f22cba7cc1.classList.toggle("trova-fullscreen-iframe");\ }\ break;\ case "hidefullscreen":\ if(iframe0c501815f87e535c740ce9f22cba7cc1 != null){\ iframe0c501815f87e535c740ce9f22cba7cc1.classList.toggle("trova-fullscreen-iframe");\ }\ break;\ }\ console.log(e)\ });\ function showwindow(){\ var iframe0c501815f87e535c740ce9f22cba7cc1 = document.getElementById("trova-frame0c501815f87e535c740ce9f22cba7cc1");\ if(iframe0c501815f87e535c740ce9f22cba7cc1 != null){\ var iframeDoc0c501815f87e535c740ce9f22cba7cc1 = iframe0c501815f87e535c740ce9f22cba7cc1.contentDocument || iframe0c501815f87e535c740ce9f22cba7cc1.contentWindow.document;\ if ( iframeDoc0c501815f87e535c740ce9f22cba7cc1 != null && iframeDoc0c501815f87e535c740ce9f22cba7cc1.readyState == "complete" ) {\ var trovadiv = iframeDoc0c501815f87e535c740ce9f22cba7cc1.getElementById("trova-div0c501815f87e535c740ce9f22cba7cc1");\ if(trovadiv != null)\ {\ if ( document != null && document.readyState == "complete" ) {\ iframe0c501815f87e535c740ce9f22cba7cc1.contentWindow.showwindow();\ }\ }\ }\ }\ }'; head.appendChild(script); var link = document.createElement('link'); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = 'https://data.trova.in/https/uigadget/assets/css/trovauigadget.css'; link.media = 'all'; head.appendChild(link); setTimeout(function(){ var dstFrame0c501815f87e535c740ce9f22cba7cc1 = document.getElementById('trova-frame0c501815f87e535c740ce9f22cba7cc1'); var dstDoc0c501815f87e535c740ce9f22cba7cc1 = dstFrame0c501815f87e535c740ce9f22cba7cc1.contentDocument || dstFrame0c501815f87e535c740ce9f22cba7cc1.contentWindow.document; dstDoc0c501815f87e535c740ce9f22cba7cc1.write(innerHTMLhttps0c501815f87e535c740ce9f22cba7cc1); dstDoc0c501815f87e535c740ce9f22cba7cc1.close(); }, 39);