Is it impossible to prevent Browser's DevTools detects my website?












0















first, I'm sorry about my bad English



I have an important website and a huge number access daily. So I don't want my rivals copy my javascript function by DevTool



I've written a script to prevent all keydown combo: CTRL + C V U A, CTRL + SHIFT + I . I know I can't prevent if they do download my site and view it by editor. I just wanna preven if they open DevTool.



My script can't prevent if my rivals open devtool before they access my website. So my question is: Is there anyway to redirect my website to another if Devtool is open, can I handle this?



Please help me. Thanks you!!. And sorry about my bad English again!
My script work



UPDATE1
I used script prevent Devtool:



(function () {
'use strict';
var devtools = {
open: false,
orientation: null
};
var threshold = 160;
var emitEvent = function (state, orientation) {
window.dispatchEvent(new CustomEvent('devtoolschange', {
detail: {
open: state,
orientation: orientation
}
}));
};

setInterval(function () {
var widthThreshold = window.outerWidth - window.innerWidth > threshold;
var heightThreshold = window.outerHeight - window.innerHeight > threshold;
var orientation = widthThreshold ? 'vertical' : 'horizontal';

if (!(heightThreshold && widthThreshold) &&
((window.Firebug && window.Firebug.chrome && window.Firebug.chrome.isInitialized) || widthThreshold || heightThreshold)) {
if (!devtools.open || devtools.orientation !== orientation) {
emitEvent(true, orientation);
}

devtools.open = true;
devtools.orientation = orientation;
} else {
if (devtools.open) {
emitEvent(false, null);
}

devtools.open = false;
devtools.orientation = null;
}
}, 500);

if (typeof module !== 'undefined' && module.exports) {
module.exports = devtools;
} else {
window.devtools = devtools;
}
})();

// check if it's open
$(document).ready(function () {
console.log('is DevTools open?', window.devtools.open);
// check it's orientation, null if not open
console.log('and DevTools orientation?', window.devtools.orientation);

// get notified when it's opened/closed or orientation changes
window.addEventListener('devtoolschange', function (e) {
console.log('is DevTools open?', e.detail.open);
console.log('and DevTools orientation?', e.detail.orientation);
});
})


But Unlucky for me, if I open devtool before I paste my website link and Enter to access, It return False:



enter image description here










share|improve this question

























  • Use a search site like google, it's easy: detect devtools.

    – wOxxOm
    Nov 21 '18 at 9:37











  • @wOxxOm oppssss! Amazing! thank youuu

    – An Pham
    Nov 21 '18 at 9:39











  • Unlucky for me, if the Rivals open devtool before they access my website. script return false

    – An Pham
    Nov 21 '18 at 9:43











  • You cannot prevent the developer tools being open. If anything else fails, people can use the API version of the developer tools and use the developer tools from a different window or machine.

    – Corion
    Nov 22 '18 at 12:26











  • @Corion Yeah, I found 1 solution in internet, The author provide me a js named "JqueyDetect" and It preven developer tools being open, It is working fine on webBrowser, Android Browser. but It reject all access in Chrome IOS xD

    – An Pham
    Nov 26 '18 at 8:17
















0















first, I'm sorry about my bad English



I have an important website and a huge number access daily. So I don't want my rivals copy my javascript function by DevTool



I've written a script to prevent all keydown combo: CTRL + C V U A, CTRL + SHIFT + I . I know I can't prevent if they do download my site and view it by editor. I just wanna preven if they open DevTool.



My script can't prevent if my rivals open devtool before they access my website. So my question is: Is there anyway to redirect my website to another if Devtool is open, can I handle this?



Please help me. Thanks you!!. And sorry about my bad English again!
My script work



UPDATE1
I used script prevent Devtool:



(function () {
'use strict';
var devtools = {
open: false,
orientation: null
};
var threshold = 160;
var emitEvent = function (state, orientation) {
window.dispatchEvent(new CustomEvent('devtoolschange', {
detail: {
open: state,
orientation: orientation
}
}));
};

setInterval(function () {
var widthThreshold = window.outerWidth - window.innerWidth > threshold;
var heightThreshold = window.outerHeight - window.innerHeight > threshold;
var orientation = widthThreshold ? 'vertical' : 'horizontal';

if (!(heightThreshold && widthThreshold) &&
((window.Firebug && window.Firebug.chrome && window.Firebug.chrome.isInitialized) || widthThreshold || heightThreshold)) {
if (!devtools.open || devtools.orientation !== orientation) {
emitEvent(true, orientation);
}

devtools.open = true;
devtools.orientation = orientation;
} else {
if (devtools.open) {
emitEvent(false, null);
}

devtools.open = false;
devtools.orientation = null;
}
}, 500);

if (typeof module !== 'undefined' && module.exports) {
module.exports = devtools;
} else {
window.devtools = devtools;
}
})();

// check if it's open
$(document).ready(function () {
console.log('is DevTools open?', window.devtools.open);
// check it's orientation, null if not open
console.log('and DevTools orientation?', window.devtools.orientation);

// get notified when it's opened/closed or orientation changes
window.addEventListener('devtoolschange', function (e) {
console.log('is DevTools open?', e.detail.open);
console.log('and DevTools orientation?', e.detail.orientation);
});
})


But Unlucky for me, if I open devtool before I paste my website link and Enter to access, It return False:



enter image description here










share|improve this question

























  • Use a search site like google, it's easy: detect devtools.

    – wOxxOm
    Nov 21 '18 at 9:37











  • @wOxxOm oppssss! Amazing! thank youuu

    – An Pham
    Nov 21 '18 at 9:39











  • Unlucky for me, if the Rivals open devtool before they access my website. script return false

    – An Pham
    Nov 21 '18 at 9:43











  • You cannot prevent the developer tools being open. If anything else fails, people can use the API version of the developer tools and use the developer tools from a different window or machine.

    – Corion
    Nov 22 '18 at 12:26











  • @Corion Yeah, I found 1 solution in internet, The author provide me a js named "JqueyDetect" and It preven developer tools being open, It is working fine on webBrowser, Android Browser. but It reject all access in Chrome IOS xD

    – An Pham
    Nov 26 '18 at 8:17














0












0








0








first, I'm sorry about my bad English



I have an important website and a huge number access daily. So I don't want my rivals copy my javascript function by DevTool



I've written a script to prevent all keydown combo: CTRL + C V U A, CTRL + SHIFT + I . I know I can't prevent if they do download my site and view it by editor. I just wanna preven if they open DevTool.



My script can't prevent if my rivals open devtool before they access my website. So my question is: Is there anyway to redirect my website to another if Devtool is open, can I handle this?



Please help me. Thanks you!!. And sorry about my bad English again!
My script work



UPDATE1
I used script prevent Devtool:



(function () {
'use strict';
var devtools = {
open: false,
orientation: null
};
var threshold = 160;
var emitEvent = function (state, orientation) {
window.dispatchEvent(new CustomEvent('devtoolschange', {
detail: {
open: state,
orientation: orientation
}
}));
};

setInterval(function () {
var widthThreshold = window.outerWidth - window.innerWidth > threshold;
var heightThreshold = window.outerHeight - window.innerHeight > threshold;
var orientation = widthThreshold ? 'vertical' : 'horizontal';

if (!(heightThreshold && widthThreshold) &&
((window.Firebug && window.Firebug.chrome && window.Firebug.chrome.isInitialized) || widthThreshold || heightThreshold)) {
if (!devtools.open || devtools.orientation !== orientation) {
emitEvent(true, orientation);
}

devtools.open = true;
devtools.orientation = orientation;
} else {
if (devtools.open) {
emitEvent(false, null);
}

devtools.open = false;
devtools.orientation = null;
}
}, 500);

if (typeof module !== 'undefined' && module.exports) {
module.exports = devtools;
} else {
window.devtools = devtools;
}
})();

// check if it's open
$(document).ready(function () {
console.log('is DevTools open?', window.devtools.open);
// check it's orientation, null if not open
console.log('and DevTools orientation?', window.devtools.orientation);

// get notified when it's opened/closed or orientation changes
window.addEventListener('devtoolschange', function (e) {
console.log('is DevTools open?', e.detail.open);
console.log('and DevTools orientation?', e.detail.orientation);
});
})


But Unlucky for me, if I open devtool before I paste my website link and Enter to access, It return False:



enter image description here










share|improve this question
















first, I'm sorry about my bad English



I have an important website and a huge number access daily. So I don't want my rivals copy my javascript function by DevTool



I've written a script to prevent all keydown combo: CTRL + C V U A, CTRL + SHIFT + I . I know I can't prevent if they do download my site and view it by editor. I just wanna preven if they open DevTool.



My script can't prevent if my rivals open devtool before they access my website. So my question is: Is there anyway to redirect my website to another if Devtool is open, can I handle this?



Please help me. Thanks you!!. And sorry about my bad English again!
My script work



UPDATE1
I used script prevent Devtool:



(function () {
'use strict';
var devtools = {
open: false,
orientation: null
};
var threshold = 160;
var emitEvent = function (state, orientation) {
window.dispatchEvent(new CustomEvent('devtoolschange', {
detail: {
open: state,
orientation: orientation
}
}));
};

setInterval(function () {
var widthThreshold = window.outerWidth - window.innerWidth > threshold;
var heightThreshold = window.outerHeight - window.innerHeight > threshold;
var orientation = widthThreshold ? 'vertical' : 'horizontal';

if (!(heightThreshold && widthThreshold) &&
((window.Firebug && window.Firebug.chrome && window.Firebug.chrome.isInitialized) || widthThreshold || heightThreshold)) {
if (!devtools.open || devtools.orientation !== orientation) {
emitEvent(true, orientation);
}

devtools.open = true;
devtools.orientation = orientation;
} else {
if (devtools.open) {
emitEvent(false, null);
}

devtools.open = false;
devtools.orientation = null;
}
}, 500);

if (typeof module !== 'undefined' && module.exports) {
module.exports = devtools;
} else {
window.devtools = devtools;
}
})();

// check if it's open
$(document).ready(function () {
console.log('is DevTools open?', window.devtools.open);
// check it's orientation, null if not open
console.log('and DevTools orientation?', window.devtools.orientation);

// get notified when it's opened/closed or orientation changes
window.addEventListener('devtoolschange', function (e) {
console.log('is DevTools open?', e.detail.open);
console.log('and DevTools orientation?', e.detail.orientation);
});
})


But Unlucky for me, if I open devtool before I paste my website link and Enter to access, It return False:



enter image description here







google-chrome-devtools devtools






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 '18 at 9:45







An Pham

















asked Nov 21 '18 at 9:34









An PhamAn Pham

42912




42912













  • Use a search site like google, it's easy: detect devtools.

    – wOxxOm
    Nov 21 '18 at 9:37











  • @wOxxOm oppssss! Amazing! thank youuu

    – An Pham
    Nov 21 '18 at 9:39











  • Unlucky for me, if the Rivals open devtool before they access my website. script return false

    – An Pham
    Nov 21 '18 at 9:43











  • You cannot prevent the developer tools being open. If anything else fails, people can use the API version of the developer tools and use the developer tools from a different window or machine.

    – Corion
    Nov 22 '18 at 12:26











  • @Corion Yeah, I found 1 solution in internet, The author provide me a js named "JqueyDetect" and It preven developer tools being open, It is working fine on webBrowser, Android Browser. but It reject all access in Chrome IOS xD

    – An Pham
    Nov 26 '18 at 8:17



















  • Use a search site like google, it's easy: detect devtools.

    – wOxxOm
    Nov 21 '18 at 9:37











  • @wOxxOm oppssss! Amazing! thank youuu

    – An Pham
    Nov 21 '18 at 9:39











  • Unlucky for me, if the Rivals open devtool before they access my website. script return false

    – An Pham
    Nov 21 '18 at 9:43











  • You cannot prevent the developer tools being open. If anything else fails, people can use the API version of the developer tools and use the developer tools from a different window or machine.

    – Corion
    Nov 22 '18 at 12:26











  • @Corion Yeah, I found 1 solution in internet, The author provide me a js named "JqueyDetect" and It preven developer tools being open, It is working fine on webBrowser, Android Browser. but It reject all access in Chrome IOS xD

    – An Pham
    Nov 26 '18 at 8:17

















Use a search site like google, it's easy: detect devtools.

– wOxxOm
Nov 21 '18 at 9:37





Use a search site like google, it's easy: detect devtools.

– wOxxOm
Nov 21 '18 at 9:37













@wOxxOm oppssss! Amazing! thank youuu

– An Pham
Nov 21 '18 at 9:39





@wOxxOm oppssss! Amazing! thank youuu

– An Pham
Nov 21 '18 at 9:39













Unlucky for me, if the Rivals open devtool before they access my website. script return false

– An Pham
Nov 21 '18 at 9:43





Unlucky for me, if the Rivals open devtool before they access my website. script return false

– An Pham
Nov 21 '18 at 9:43













You cannot prevent the developer tools being open. If anything else fails, people can use the API version of the developer tools and use the developer tools from a different window or machine.

– Corion
Nov 22 '18 at 12:26





You cannot prevent the developer tools being open. If anything else fails, people can use the API version of the developer tools and use the developer tools from a different window or machine.

– Corion
Nov 22 '18 at 12:26













@Corion Yeah, I found 1 solution in internet, The author provide me a js named "JqueyDetect" and It preven developer tools being open, It is working fine on webBrowser, Android Browser. but It reject all access in Chrome IOS xD

– An Pham
Nov 26 '18 at 8:17





@Corion Yeah, I found 1 solution in internet, The author provide me a js named "JqueyDetect" and It preven developer tools being open, It is working fine on webBrowser, Android Browser. but It reject all access in Chrome IOS xD

– An Pham
Nov 26 '18 at 8:17












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53409004%2fis-it-impossible-to-prevent-browsers-devtools-detects-my-website%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53409004%2fis-it-impossible-to-prevent-browsers-devtools-detects-my-website%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown