├── .gitignore ├── LICENSE ├── README.md ├── assets ├── Large Promo.png ├── Marquee.png ├── Small Promo.png ├── screenshot1.png ├── screenshot2.png ├── screenshot3.png └── screenshot4.png ├── mobile-devtools.crx ├── package-lock.json ├── package.json └── src ├── background.html ├── background.js ├── icons ├── mobile-devtools128.png ├── mobile-devtools16.png ├── mobile-devtools32.png └── mobile-devtools48.png ├── manifest.json ├── mobile-devtools.js └── toggle-devtools.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (https://nodejs.org/api/addons.html) 33 | build/ 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # TypeScript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | # next.js build output 61 | .next 62 | 63 | # crx private key 64 | key.pem 65 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Lucas Volle 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ![](https://raw.githubusercontent.com/volleio/mobile-devtools/master/src/icons/mobile-devtools32.png "mobile-devtools logo") Mobile DevTools 2 | ### A mobile browser extension for debugging web apps. Based on the open source project [Eruda](https://eruda.liriliri.io/), Mobile DevTools allows you to view the console, DOM elements, network traffic, page source, resources, and more. 3 | 4 | Click the extensions's icon in the toolbar or menu to open the overlay. Drag the top menu left & right and tap on a tab to open: 5 | - Console: View JavaScript logs, errors, warnings, and other debug info. Execute arbitrary JS to interact with the webpage. 6 | - Elements: Drill down into the DOM tree to see attributes, inline styles, CSS rules, and computed styles. 7 | - Network: Record in detail the network requests being made and inspect the responses. 8 | - Resource: Show local storage, session storage, cookies, scripts, stylesheets, iframes, and image assets. 9 | - Sources: Source code viewer for HTML, JS, and CSS. 10 | - Info: View the current URL, User Agent, and device details. 11 | - Snippets: Execute useful JavaScript snippets. If you're a developer and would like to add additional plugins, please visit Eruda's documentation at https://github.com/liriliri/eruda and contact the developer of this extension! 12 | 13 | _Mobile DevTools may not work on all websites, depending on the page content's security policies._ 14 | -------------------------------------------------------------------------------- /assets/Large Promo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/volleio/mobile-devtools/85ae173e08bac378b6bc9de9a720cabb33006400/assets/Large Promo.png -------------------------------------------------------------------------------- /assets/Marquee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/volleio/mobile-devtools/85ae173e08bac378b6bc9de9a720cabb33006400/assets/Marquee.png -------------------------------------------------------------------------------- /assets/Small Promo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/volleio/mobile-devtools/85ae173e08bac378b6bc9de9a720cabb33006400/assets/Small Promo.png -------------------------------------------------------------------------------- /assets/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/volleio/mobile-devtools/85ae173e08bac378b6bc9de9a720cabb33006400/assets/screenshot1.png -------------------------------------------------------------------------------- /assets/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/volleio/mobile-devtools/85ae173e08bac378b6bc9de9a720cabb33006400/assets/screenshot2.png -------------------------------------------------------------------------------- /assets/screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/volleio/mobile-devtools/85ae173e08bac378b6bc9de9a720cabb33006400/assets/screenshot3.png -------------------------------------------------------------------------------- /assets/screenshot4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/volleio/mobile-devtools/85ae173e08bac378b6bc9de9a720cabb33006400/assets/screenshot4.png -------------------------------------------------------------------------------- /mobile-devtools.crx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/volleio/mobile-devtools/85ae173e08bac378b6bc9de9a720cabb33006400/mobile-devtools.crx -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mobile-devtools", 3 | "version": "0.0.1", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "archiver": { 8 | "version": "3.1.1", 9 | "resolved": "https://registry.npmjs.org/archiver/-/archiver-3.1.1.tgz", 10 | "integrity": "sha512-5Hxxcig7gw5Jod/8Gq0OneVgLYET+oNHcxgWItq4TbhOzRLKNAFUb9edAftiMKXvXfCB0vbGrJdZDNq0dWMsxg==", 11 | "requires": { 12 | "archiver-utils": "^2.1.0", 13 | "async": "^2.6.3", 14 | "buffer-crc32": "^0.2.1", 15 | "glob": "^7.1.4", 16 | "readable-stream": "^3.4.0", 17 | "tar-stream": "^2.1.0", 18 | "zip-stream": "^2.1.2" 19 | }, 20 | "dependencies": { 21 | "readable-stream": { 22 | "version": "3.4.0", 23 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", 24 | "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", 25 | "requires": { 26 | "inherits": "^2.0.3", 27 | "string_decoder": "^1.1.1", 28 | "util-deprecate": "^1.0.1" 29 | } 30 | } 31 | } 32 | }, 33 | "archiver-utils": { 34 | "version": "2.1.0", 35 | "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-2.1.0.tgz", 36 | "integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==", 37 | "requires": { 38 | "glob": "^7.1.4", 39 | "graceful-fs": "^4.2.0", 40 | "lazystream": "^1.0.0", 41 | "lodash.defaults": "^4.2.0", 42 | "lodash.difference": "^4.5.0", 43 | "lodash.flatten": "^4.4.0", 44 | "lodash.isplainobject": "^4.0.6", 45 | "lodash.union": "^4.6.0", 46 | "normalize-path": "^3.0.0", 47 | "readable-stream": "^2.0.0" 48 | }, 49 | "dependencies": { 50 | "normalize-path": { 51 | "version": "3.0.0", 52 | "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", 53 | "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" 54 | } 55 | } 56 | }, 57 | "asn1": { 58 | "version": "0.2.4", 59 | "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", 60 | "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", 61 | "requires": { 62 | "safer-buffer": "~2.1.0" 63 | } 64 | }, 65 | "async": { 66 | "version": "2.6.3", 67 | "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", 68 | "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", 69 | "requires": { 70 | "lodash": "^4.17.14" 71 | } 72 | }, 73 | "balanced-match": { 74 | "version": "1.0.0", 75 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 76 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" 77 | }, 78 | "base64-js": { 79 | "version": "1.3.1", 80 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", 81 | "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" 82 | }, 83 | "bl": { 84 | "version": "3.0.0", 85 | "resolved": "https://registry.npmjs.org/bl/-/bl-3.0.0.tgz", 86 | "integrity": "sha512-EUAyP5UHU5hxF8BPT0LKW8gjYLhq1DQIcneOX/pL/m2Alo+OYDQAJlHq+yseMP50Os2nHXOSic6Ss3vSQeyf4A==", 87 | "requires": { 88 | "readable-stream": "^3.0.1" 89 | }, 90 | "dependencies": { 91 | "readable-stream": { 92 | "version": "3.4.0", 93 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", 94 | "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", 95 | "requires": { 96 | "inherits": "^2.0.3", 97 | "string_decoder": "^1.1.1", 98 | "util-deprecate": "^1.0.1" 99 | } 100 | } 101 | } 102 | }, 103 | "brace-expansion": { 104 | "version": "1.1.11", 105 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 106 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 107 | "requires": { 108 | "balanced-match": "^1.0.0", 109 | "concat-map": "0.0.1" 110 | } 111 | }, 112 | "buffer": { 113 | "version": "5.4.0", 114 | "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.4.0.tgz", 115 | "integrity": "sha512-Xpgy0IwHK2N01ncykXTy6FpCWuM+CJSHoPVBLyNqyrWxsedpLvwsYUhf0ME3WRFNUhos0dMamz9cOS/xRDtU5g==", 116 | "requires": { 117 | "base64-js": "^1.0.2", 118 | "ieee754": "^1.1.4" 119 | } 120 | }, 121 | "buffer-crc32": { 122 | "version": "0.2.13", 123 | "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", 124 | "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=" 125 | }, 126 | "co": { 127 | "version": "4.6.0", 128 | "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", 129 | "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" 130 | }, 131 | "commander": { 132 | "version": "2.20.0", 133 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", 134 | "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==" 135 | }, 136 | "compress-commons": { 137 | "version": "2.1.1", 138 | "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-2.1.1.tgz", 139 | "integrity": "sha512-eVw6n7CnEMFzc3duyFVrQEuY1BlHR3rYsSztyG32ibGMW722i3C6IizEGMFmfMU+A+fALvBIwxN3czffTcdA+Q==", 140 | "requires": { 141 | "buffer-crc32": "^0.2.13", 142 | "crc32-stream": "^3.0.1", 143 | "normalize-path": "^3.0.0", 144 | "readable-stream": "^2.3.6" 145 | }, 146 | "dependencies": { 147 | "normalize-path": { 148 | "version": "3.0.0", 149 | "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", 150 | "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" 151 | } 152 | } 153 | }, 154 | "concat-map": { 155 | "version": "0.0.1", 156 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 157 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" 158 | }, 159 | "core-util-is": { 160 | "version": "1.0.2", 161 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 162 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 163 | }, 164 | "cpx2": { 165 | "version": "2.0.0", 166 | "resolved": "https://registry.npmjs.org/cpx2/-/cpx2-2.0.0.tgz", 167 | "integrity": "sha512-hSkh9xHmUnHMxVS99SpACbAw6jOCaji0KyepBQ4/ULZQ+RB+3uP2PB/zylOCjSxZv9/cvoeG1XuQbZPyNuYftA==", 168 | "requires": { 169 | "co": "^4.6.0", 170 | "debounce": "^1.2.0", 171 | "debug": "^4.1.1", 172 | "duplexer": "^0.1.1", 173 | "fs-extra": "^8.1.0", 174 | "glob": "^7.1.4", 175 | "glob2base": "0.0.12", 176 | "minimatch": "^3.0.4", 177 | "resolve": "^1.12.0", 178 | "safe-buffer": "^5.2.0", 179 | "shell-quote": "^1.7.1", 180 | "subarg": "^1.0.0" 181 | } 182 | }, 183 | "crc": { 184 | "version": "3.8.0", 185 | "resolved": "https://registry.npmjs.org/crc/-/crc-3.8.0.tgz", 186 | "integrity": "sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==", 187 | "requires": { 188 | "buffer": "^5.1.0" 189 | } 190 | }, 191 | "crc32-stream": { 192 | "version": "3.0.1", 193 | "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-3.0.1.tgz", 194 | "integrity": "sha512-mctvpXlbzsvK+6z8kJwSJ5crm7yBwrQMTybJzMw1O4lLGJqjlDCXY2Zw7KheiA6XBEcBmfLx1D88mjRGVJtY9w==", 195 | "requires": { 196 | "crc": "^3.4.4", 197 | "readable-stream": "^3.4.0" 198 | }, 199 | "dependencies": { 200 | "readable-stream": { 201 | "version": "3.4.0", 202 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", 203 | "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", 204 | "requires": { 205 | "inherits": "^2.0.3", 206 | "string_decoder": "^1.1.1", 207 | "util-deprecate": "^1.0.1" 208 | } 209 | } 210 | } 211 | }, 212 | "crx": { 213 | "version": "5.0.1", 214 | "resolved": "https://registry.npmjs.org/crx/-/crx-5.0.1.tgz", 215 | "integrity": "sha512-n/PzBx/fR1+xZCiJBats9y5zw/a+YBcoJ0ABnUaY56xb1RpXuFhsiCMpNY6WjVtylLzhUUXSWsbitesVg7v2vg==", 216 | "requires": { 217 | "archiver": "^3.0.3", 218 | "commander": "^2.20.0", 219 | "node-rsa": "^1.0.5", 220 | "pbf": "^3.2.0" 221 | } 222 | }, 223 | "debounce": { 224 | "version": "1.2.0", 225 | "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.0.tgz", 226 | "integrity": "sha512-mYtLl1xfZLi1m4RtQYlZgJUNQjl4ZxVnHzIR8nLLgi4q1YT8o/WM+MK/f8yfcc9s5Ir5zRaPZyZU6xs1Syoocg==" 227 | }, 228 | "debug": { 229 | "version": "4.1.1", 230 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", 231 | "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", 232 | "requires": { 233 | "ms": "^2.1.1" 234 | } 235 | }, 236 | "duplexer": { 237 | "version": "0.1.1", 238 | "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", 239 | "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=" 240 | }, 241 | "end-of-stream": { 242 | "version": "1.4.1", 243 | "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", 244 | "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", 245 | "requires": { 246 | "once": "^1.4.0" 247 | } 248 | }, 249 | "eruda": { 250 | "version": "github:volleio/eruda#21e244a9862883c65d3aaa981431ad73e98348f5", 251 | "from": "github:volleio/eruda#build" 252 | }, 253 | "find-index": { 254 | "version": "0.1.1", 255 | "resolved": "https://registry.npmjs.org/find-index/-/find-index-0.1.1.tgz", 256 | "integrity": "sha1-Z101iyyjiS15Whq0cjL4tuLg3eQ=" 257 | }, 258 | "fs-constants": { 259 | "version": "1.0.0", 260 | "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", 261 | "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" 262 | }, 263 | "fs-extra": { 264 | "version": "8.1.0", 265 | "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", 266 | "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", 267 | "requires": { 268 | "graceful-fs": "^4.2.0", 269 | "jsonfile": "^4.0.0", 270 | "universalify": "^0.1.0" 271 | } 272 | }, 273 | "fs.realpath": { 274 | "version": "1.0.0", 275 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 276 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" 277 | }, 278 | "glob": { 279 | "version": "7.1.4", 280 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", 281 | "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", 282 | "requires": { 283 | "fs.realpath": "^1.0.0", 284 | "inflight": "^1.0.4", 285 | "inherits": "2", 286 | "minimatch": "^3.0.4", 287 | "once": "^1.3.0", 288 | "path-is-absolute": "^1.0.0" 289 | } 290 | }, 291 | "glob2base": { 292 | "version": "0.0.12", 293 | "resolved": "https://registry.npmjs.org/glob2base/-/glob2base-0.0.12.tgz", 294 | "integrity": "sha1-nUGbPijxLoOjYhZKJ3BVkiycDVY=", 295 | "requires": { 296 | "find-index": "^0.1.1" 297 | } 298 | }, 299 | "graceful-fs": { 300 | "version": "4.2.2", 301 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", 302 | "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==" 303 | }, 304 | "ieee754": { 305 | "version": "1.1.13", 306 | "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", 307 | "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" 308 | }, 309 | "inflight": { 310 | "version": "1.0.6", 311 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 312 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 313 | "requires": { 314 | "once": "^1.3.0", 315 | "wrappy": "1" 316 | } 317 | }, 318 | "inherits": { 319 | "version": "2.0.4", 320 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 321 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 322 | }, 323 | "isarray": { 324 | "version": "1.0.0", 325 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 326 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 327 | }, 328 | "jsonfile": { 329 | "version": "4.0.0", 330 | "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", 331 | "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", 332 | "requires": { 333 | "graceful-fs": "^4.1.6" 334 | } 335 | }, 336 | "lazystream": { 337 | "version": "1.0.0", 338 | "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", 339 | "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", 340 | "requires": { 341 | "readable-stream": "^2.0.5" 342 | } 343 | }, 344 | "lodash": { 345 | "version": "4.17.15", 346 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", 347 | "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" 348 | }, 349 | "lodash.defaults": { 350 | "version": "4.2.0", 351 | "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", 352 | "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=" 353 | }, 354 | "lodash.difference": { 355 | "version": "4.5.0", 356 | "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", 357 | "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=" 358 | }, 359 | "lodash.flatten": { 360 | "version": "4.4.0", 361 | "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", 362 | "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=" 363 | }, 364 | "lodash.isplainobject": { 365 | "version": "4.0.6", 366 | "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", 367 | "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" 368 | }, 369 | "lodash.union": { 370 | "version": "4.6.0", 371 | "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", 372 | "integrity": "sha1-SLtQiECfFvGCFmZkHETdGqrjzYg=" 373 | }, 374 | "minimatch": { 375 | "version": "3.0.4", 376 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 377 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 378 | "requires": { 379 | "brace-expansion": "^1.1.7" 380 | } 381 | }, 382 | "minimist": { 383 | "version": "1.2.5", 384 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", 385 | "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" 386 | }, 387 | "ms": { 388 | "version": "2.1.2", 389 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 390 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" 391 | }, 392 | "node-rsa": { 393 | "version": "1.0.5", 394 | "resolved": "https://registry.npmjs.org/node-rsa/-/node-rsa-1.0.5.tgz", 395 | "integrity": "sha512-9o51yfV167CtQANnuAf+5owNs7aIMsAKVLhNaKuRxihsUUnfoBMN5OTVOK/2mHSOWaWq9zZBiRM3bHORbTZqrg==", 396 | "requires": { 397 | "asn1": "^0.2.4" 398 | } 399 | }, 400 | "once": { 401 | "version": "1.4.0", 402 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 403 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 404 | "requires": { 405 | "wrappy": "1" 406 | } 407 | }, 408 | "path-is-absolute": { 409 | "version": "1.0.1", 410 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 411 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" 412 | }, 413 | "path-parse": { 414 | "version": "1.0.6", 415 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", 416 | "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" 417 | }, 418 | "pbf": { 419 | "version": "3.2.0", 420 | "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.2.0.tgz", 421 | "integrity": "sha512-98Eh7rsJNJF/Im6XYMLaOW3cLnNyedlOd6hu3iWMD5I7FZGgpw8yN3vQBrmLbLodu7G784Irb9Qsv2yFrxSAGw==", 422 | "requires": { 423 | "ieee754": "^1.1.12", 424 | "resolve-protobuf-schema": "^2.1.0" 425 | } 426 | }, 427 | "process-nextick-args": { 428 | "version": "2.0.1", 429 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 430 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" 431 | }, 432 | "protocol-buffers-schema": { 433 | "version": "3.3.2", 434 | "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.3.2.tgz", 435 | "integrity": "sha512-Xdayp8sB/mU+sUV4G7ws8xtYMGdQnxbeIfLjyO9TZZRJdztBGhlmbI5x1qcY4TG5hBkIKGnc28i7nXxaugu88w==" 436 | }, 437 | "readable-stream": { 438 | "version": "2.3.6", 439 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", 440 | "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", 441 | "requires": { 442 | "core-util-is": "~1.0.0", 443 | "inherits": "~2.0.3", 444 | "isarray": "~1.0.0", 445 | "process-nextick-args": "~2.0.0", 446 | "safe-buffer": "~5.1.1", 447 | "string_decoder": "~1.1.1", 448 | "util-deprecate": "~1.0.1" 449 | }, 450 | "dependencies": { 451 | "safe-buffer": { 452 | "version": "5.1.2", 453 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 454 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 455 | } 456 | } 457 | }, 458 | "resolve": { 459 | "version": "1.12.0", 460 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", 461 | "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", 462 | "requires": { 463 | "path-parse": "^1.0.6" 464 | } 465 | }, 466 | "resolve-protobuf-schema": { 467 | "version": "2.1.0", 468 | "resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz", 469 | "integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==", 470 | "requires": { 471 | "protocol-buffers-schema": "^3.3.1" 472 | } 473 | }, 474 | "rimraf": { 475 | "version": "3.0.0", 476 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz", 477 | "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==", 478 | "requires": { 479 | "glob": "^7.1.3" 480 | } 481 | }, 482 | "safe-buffer": { 483 | "version": "5.2.0", 484 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", 485 | "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" 486 | }, 487 | "safer-buffer": { 488 | "version": "2.1.2", 489 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 490 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 491 | }, 492 | "shell-quote": { 493 | "version": "1.7.1", 494 | "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.1.tgz", 495 | "integrity": "sha512-2kUqeAGnMAu6YrTPX4E3LfxacH9gKljzVjlkUeSqY0soGwK4KLl7TURXCem712tkhBCeeaFP9QK4dKn88s3Icg==" 496 | }, 497 | "string_decoder": { 498 | "version": "1.1.1", 499 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 500 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 501 | "requires": { 502 | "safe-buffer": "~5.1.0" 503 | }, 504 | "dependencies": { 505 | "safe-buffer": { 506 | "version": "5.1.2", 507 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 508 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 509 | } 510 | } 511 | }, 512 | "subarg": { 513 | "version": "1.0.0", 514 | "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", 515 | "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", 516 | "requires": { 517 | "minimist": "^1.1.0" 518 | } 519 | }, 520 | "tar-stream": { 521 | "version": "2.1.0", 522 | "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.0.tgz", 523 | "integrity": "sha512-+DAn4Nb4+gz6WZigRzKEZl1QuJVOLtAwwF+WUxy1fJ6X63CaGaUAxJRD2KEn1OMfcbCjySTYpNC6WmfQoIEOdw==", 524 | "requires": { 525 | "bl": "^3.0.0", 526 | "end-of-stream": "^1.4.1", 527 | "fs-constants": "^1.0.0", 528 | "inherits": "^2.0.3", 529 | "readable-stream": "^3.1.1" 530 | }, 531 | "dependencies": { 532 | "readable-stream": { 533 | "version": "3.4.0", 534 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", 535 | "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", 536 | "requires": { 537 | "inherits": "^2.0.3", 538 | "string_decoder": "^1.1.1", 539 | "util-deprecate": "^1.0.1" 540 | } 541 | } 542 | } 543 | }, 544 | "universalify": { 545 | "version": "0.1.2", 546 | "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", 547 | "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" 548 | }, 549 | "util-deprecate": { 550 | "version": "1.0.2", 551 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 552 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 553 | }, 554 | "wrappy": { 555 | "version": "1.0.2", 556 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 557 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" 558 | }, 559 | "zip-stream": { 560 | "version": "2.1.2", 561 | "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-2.1.2.tgz", 562 | "integrity": "sha512-ykebHGa2+uzth/R4HZLkZh3XFJzivhVsjJt8bN3GvBzLaqqrUdRacu+c4QtnUgjkkQfsOuNE1JgLKMCPNmkKgg==", 563 | "requires": { 564 | "archiver-utils": "^2.1.0", 565 | "compress-commons": "^2.1.1", 566 | "readable-stream": "^3.4.0" 567 | }, 568 | "dependencies": { 569 | "readable-stream": { 570 | "version": "3.4.0", 571 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", 572 | "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", 573 | "requires": { 574 | "inherits": "^2.0.3", 575 | "string_decoder": "^1.1.1", 576 | "util-deprecate": "^1.0.1" 577 | } 578 | } 579 | } 580 | } 581 | } 582 | } 583 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mobile-devtools", 3 | "version": "0.0.1", 4 | "description": "Mobile browser extension based on Eruda for debugging.", 5 | "scripts": { 6 | "build": "npm run cleanup && npm run copy-assets && npm run pack", 7 | "copy-assets": "cpx \"src/**/*.{html,js,json,png}\" ./build && cpx node_modules/eruda/eruda.min.js ./build", 8 | "pack": "crx pack build -o mobile-devtools.crx", 9 | "cleanup": "rimraf build/" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/volleio/mobile-devtools.git" 14 | }, 15 | "author": "Lucas Volle", 16 | "license": "MIT", 17 | "bugs": { 18 | "url": "https://github.com/volleio/mobile-devtools/issues" 19 | }, 20 | "homepage": "https://github.com/volleio/mobile-devtools#readme", 21 | "dependencies": { 22 | "cpx2": "^2.0.0", 23 | "crx": "^5.0.1", 24 | "eruda": "github:volleio/eruda#build", 25 | "rimraf": "^3.0.0" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/background.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/background.js: -------------------------------------------------------------------------------- 1 | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 2 | (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 3 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 4 | })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); 5 | 6 | ga('create', 'UA-68030939-2', 'auto'); 7 | ga('set', 'checkProtocolTask', null); // Disables file protocol checking. 8 | 9 | 10 | chrome.browserAction.onClicked.addListener((tab) => { 11 | if (tab) { 12 | try { 13 | chrome.tabs.sendMessage(tab.id, { action: "toggle_devtools" }, (response) => { 14 | if (!response || !response.success) { 15 | chrome.runtime.lastError.message; // literally just ackknowledge that the call failed so Chrome doesn't log it 16 | chrome.tabs.executeScript(tab.id, { file: 'mobile-devtools.js' }); 17 | ga('send', 'pageview', '/popup'); // Indicate initial execution, avoiding rejection due to chrome-extension protocol 18 | } 19 | }); 20 | } 21 | catch(err) { } // sendMessage will fail in extensions menu, new tab, etc. 22 | } 23 | }); 24 | -------------------------------------------------------------------------------- /src/icons/mobile-devtools128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/volleio/mobile-devtools/85ae173e08bac378b6bc9de9a720cabb33006400/src/icons/mobile-devtools128.png -------------------------------------------------------------------------------- /src/icons/mobile-devtools16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/volleio/mobile-devtools/85ae173e08bac378b6bc9de9a720cabb33006400/src/icons/mobile-devtools16.png -------------------------------------------------------------------------------- /src/icons/mobile-devtools32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/volleio/mobile-devtools/85ae173e08bac378b6bc9de9a720cabb33006400/src/icons/mobile-devtools32.png -------------------------------------------------------------------------------- /src/icons/mobile-devtools48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/volleio/mobile-devtools/85ae173e08bac378b6bc9de9a720cabb33006400/src/icons/mobile-devtools48.png -------------------------------------------------------------------------------- /src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Mobile DevTools", 3 | "version": "0.1.0", 4 | "manifest_version": 2, 5 | "description": "A mobile browser extension for debugging web sites and applications with the console, DOM, network info, sources, and more.", 6 | "homepage_url": "https://github.com/volleio/mobile-devtools#readme", 7 | "icons": { 8 | "16": "icons/mobile-devtools16.png", 9 | "48": "icons/mobile-devtools48.png", 10 | "128": "icons/mobile-devtools128.png" 11 | }, 12 | "background": { 13 | "page": "background.html", 14 | "persistent": false 15 | }, 16 | "browser_action": { 17 | "default_title": "Mobile DevTools" 18 | }, 19 | "web_accessible_resources": [ 20 | "eruda.min.js", 21 | "toggle-devtools.js" 22 | ], 23 | "permissions": [ 24 | "activeTab" 25 | ], 26 | "content_security_policy": "script-src 'self' https://www.googletagmanager.com https://www.google-analytics.com; object-src 'self'" 27 | } -------------------------------------------------------------------------------- /src/mobile-devtools.js: -------------------------------------------------------------------------------- 1 | chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { 2 | if (request.action === "toggle_devtools") { 3 | sendResponse({ success: true }); 4 | 5 | if (document.getElementById('toggle-devtools.js')) 6 | document.getElementById('toggle-devtools.js').remove(); 7 | 8 | addScriptToHead('toggle-devtools.js'); 9 | } 10 | }); 11 | 12 | addLoadingSpinner(); 13 | addScriptToHead('eruda.min.js'); 14 | addScriptToHead('toggle-devtools.js'); 15 | 16 | 17 | function addScriptToHead(url) { 18 | const script = document.createElement('script'); 19 | script.id = url; 20 | script.src = chrome.extension.getURL(url); 21 | (document.head||document.documentElement).appendChild(script); 22 | } 23 | 24 | function addLoadingSpinner() { 25 | const styles = document.createElement('style'); 26 | (document.head||document.documentElement).appendChild(styles); 27 | styles.innerHTML = ` 28 | .mobile-devtools-loader, 29 | .mobile-devtools-loader:before, 30 | .mobile-devtools-loader:after { 31 | position: fixed; 32 | bottom: 100px; 33 | margin-left: 50%; 34 | margin-right: 50%; 35 | width: 10px; 36 | height: 40px; 37 | z-index: 999999999; 38 | background: #2196f3; 39 | animation: mobile-devtool-loading 1s infinite ease-in-out; 40 | } 41 | .mobile-devtools-loader { 42 | color: #2196f3; 43 | transform: translateZ(0); 44 | animation-delay: -0.16s; 45 | } 46 | .mobile-devtools-loader:before, 47 | .mobile-devtools-loader:after { 48 | position: absolute; 49 | top: 0; 50 | content: ''; 51 | } 52 | .mobile-devtools-loader:before { 53 | left: -25px; 54 | animation-delay: -0.32s; 55 | } 56 | .mobile-devtools-loader:after { 57 | left: 15px; 58 | } 59 | @keyframes mobile-devtool-loading { 60 | 0%, 61 | 80%, 62 | 100% { 63 | box-shadow: 0 0; 64 | height: 40px; 65 | } 66 | 40% { 67 | box-shadow: 0 -20px; 68 | height: 50px; 69 | } 70 | } 71 | `; 72 | 73 | const loadingSpinner = document.createElement('div'); 74 | loadingSpinner.id = 'mobile-devtools-loader'; 75 | loadingSpinner.className = 'mobile-devtools-loader'; 76 | document.body.appendChild(loadingSpinner); 77 | } 78 | -------------------------------------------------------------------------------- /src/toggle-devtools.js: -------------------------------------------------------------------------------- 1 | function initializeEruda() { 2 | eruda.init(); 3 | eruda.show(); // Show by default because extension button was just clicked 4 | document.getElementById('mobile-devtools-loader').remove(); // Remove loading spinner now that eruda is visible 5 | } 6 | 7 | if (window.eruda) { 8 | if (!eruda._isInit) { 9 | initializeEruda(); 10 | } else { 11 | const devTools = eruda._$el[0].querySelector('.eruda-dev-tools'); 12 | if (devTools.offsetHeight > 0) 13 | eruda.hide(); 14 | else 15 | eruda.show(); 16 | } 17 | } else { 18 | let readyStateCheckInterval = setInterval(function() { 19 | if (window.eruda) { 20 | clearInterval(readyStateCheckInterval); 21 | initializeEruda(); 22 | } 23 | }, 40); 24 | } 25 | --------------------------------------------------------------------------------