├── README.md ├── devtools.html ├── manifest.json └── devtools.js /README.md: -------------------------------------------------------------------------------- 1 | # chrome-59-show-setinterval-issue-code 2 | -------------------------------------------------------------------------------- /devtools.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Chrome Query", 3 | "version": "1.1", 4 | "description": "Extends the Developer Tools, adding a sidebar that displays the jQuery data associated with the selected DOM element.", 5 | "devtools_page": "devtools.html", 6 | "manifest_version": 2 7 | } 8 | -------------------------------------------------------------------------------- /devtools.js: -------------------------------------------------------------------------------- 1 | function createPanelIfReactLoaded() { 2 | chrome.devtools.inspectedWindow.eval(`jQuery.fn.jquery`, function(pageHasReact, err) { 3 | if (!pageHasReact || panelCreated) { 4 | return; 5 | } 6 | 7 | clearInterval(loadCheckInterval); 8 | }); 9 | } 10 | 11 | chrome.devtools.network.onNavigated.addListener(function() { 12 | createPanelIfReactLoaded(); 13 | }); 14 | 15 | // Check to see if React has loaded once per second in case React is added 16 | // after page load 17 | var loadCheckInterval = setInterval(function() { 18 | createPanelIfReactLoaded(); 19 | }, 1000); 20 | 21 | createPanelIfReactLoaded(); 22 | --------------------------------------------------------------------------------