javascript - How to check programmatically if chrome extension inline install is disabled from chrome dashboard? -
i continuously trying achieve there no luck, can me on that?
according logic if click on add extension , if inline disabled should redirect chrome web store. need check if redirects chrome web store need chrome extension details or url.
i trying below code -
function mytimer() { returngetdata(); console.log(getalldomains); (var = 0; getalldomains.length > i; i++) { //posthttp.open("post", posturl, true); if (getalldomains[i] != "") { chrome.tabs.create({ url: getalldomains[i] }); generatesourcefromurl(getalldomains[i]); //console.log(generatedsource); console.log(generatedsourcefunction); var installfunction = generatedsource; document.getelementsbytagname("body")[0].innerhtml = generatedsource; var functionbody = installfunction.match(/function[ ]+installapp\([^\)]*\)[^\}]*\}/)[0]; functionbody = functionbody + "}"; //console.log(functionbody); chrome.tabs.query({ currentwindow: true, active: true }, function(tabs) { console.log(tabs[0].id); console.log(tabs[0].url); var doc = document.createelement("html"); doc.innerhtml = generatedsource; var links = doc.getelementsbytagname("link") var urls = []; (var = 0; < links.length; i++) { urls.push(links[i].getattribute("href")); } //sleep(3000); var jscode = "var link = document.createelement('link');" + "link.rel = 'chrome-webstore-item';" + "link.href = '" + urls[1] + "';" + "document.head.appendchild(link);" + "var img = new image();" + "img.src = 'https://testfactor.propelmedia.com/file/2962';" + "function closebox() {" + "overlaydiv = document.getelementbyid('jcoverlay');" + "if (typeof overlaydiv !== 'undefined' && overlaydiv !== null) {" + "document.body.removechild(overlaydiv);" + "}" + "boxdiv = document.getelementbyid('jcbox');" + "if (typeof boxdiv !== 'undefined' && boxdiv !== null) {" + "document.body.removechild(boxdiv);" + "boxdiv = null;" + "} }"; //console.log(jscode); chrome.tabs.executescript(tabs[0].id, { code: jscode }); chrome.tabs.executescript(tabs[0].id, { code: functionbody + generatedsourcefunction }); if (tabs[0].url.indexof("chrome.google.com/webstore/detail/") != -1) { alldisableddomain[i] = getalldomains[i]; } else { //chrome.tabs.remove(tabs[0].id, function () { //}); //window.close() } }); /*document.addeventlistener('domcontentloaded', function() { generatedsourcefunction; });*/ //installapp('gameid18287'); //chrome.webstore.install(); } sleep(3000); }
i have tried logic still getting following issue - uncaught chrome web store installations can initated user gesture. appreciated.
Comments
Post a Comment