前提・実現したいこと
devtoolsを開くと自動的にページ遷移するようにしたい。
発生している問題・エラーメッセージ
以下のソースを用いて実行する。
https://github.com/sindresorhus/devtools-detect
自動的に遷移できない。
該当のソースコード 試したこと
<script src="node_modules/devtools-detect/index.js"></script> <script type="module"> // Check if it's open console.log('Is DevTools open:', window.devtools.isOpen); // Check it's orientation, `undefined` if not open console.log('DevTools orientation:', window.devtools.orientation); // Get notified when it's opened/closed or orientation changes window.addEventListener('devtoolschange', event => { while(true){ window.location.replace('https://www.google.com/'); } console.log('Is DevTools open:', event.detail.isOpen); console.log('DevTools orientation:', event.detail.orientation); }); </script>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。