theajack / disable-devtool

Disable web developer tools from the f12 button, right-click and browser menu

Home Page:https://theajack.github.io/disable-devtool/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chrome-extension issue

ExpandXSoln opened this issue · comments

tried loading it through chrome extension like below but not working

content.js
var helperScripts = document.createElement('script');
helperScripts.setAttribute('disable-devtool-auto','');
helperScripts.setAttribute("md5", "71f6ac3385ce284152a64208521c592b");
helperScripts.src = chrome.runtime.getURL('helperRoutines.js');
document.head.insertBefore(helperScripts, document.head.firstElementChild);

helperRoutines.js -> this has the minifed code for the blocking as per your code

manifest is as follows
"content_scripts": [{
"exclude_globs": [
"chrome://extensions/"
],
"matches": [
"://.incometax.gov.in/"
],
"all_frames": true,
"js": ["jquery.min.js","content.js"]
}],
"web_accessible_resources": [{
"resources": ["inject.js","helperRoutines.js"],
"matches": [ "
://.incometax.gov.in/" ]
}],

The script is getting injected but does not have any effect
after injection it looks like following

<script disable-devtool-auto md5="71f6ac3385ce284152a64208521c592b" src="chrome-extension://gnpngafhhnadjdebljpoknfkcaffjfki/helperRoutines.js"></script>

But I am able to open the dev tools, please let me know what I am doing wrong

tried below code as well
helperScripts.addEventListener("load", scriptLoaded, false);

function scriptLoaded() {
console.log("helperScripts is ready to rock and roll!");
disableDevtool(); //DisableDevTool() also tried but this is giving error always
}

Same issue with disableDevtool line giving error saying undefined function

Any help would be highly appreciated

I tried diable-devtool in chrome-extension, and it works fine.

So maybe this is not problem with diable-devtool, I think you can try putting the code directly in the Google plugin where you can run js,and see if it works

Start by copying all the code here into your js, then add a line of code below

DisableDevtool();