Skip to content

Commit

Permalink
fix return to elements panel not working
Browse files Browse the repository at this point in the history
  • Loading branch information
kynetiv committed Jun 16, 2018
1 parent 02c88ed commit 433e937
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ This chrome extension simply reload's the current window and refocuses on the el

####... _why?_
1. I wanted to learn more about chrome extentions
2. I'm lasy and want to refresh devtools without moving another finger ;-) Honestly though, other browsers have a refresh button in devtools, but not chrome for whatever reason.
2. I'm lazy and want to refresh devtools without moving another finger ;-) Honestly though, other browsers have a refresh button in devtools, but not chrome for whatever reason.

4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Chrome Devtools Refresh Btn",
"version": "1.0.0",
"name": "Chrome Devtools Refresh Button",
"version": "1.0.1",
"manifest_version": 2,
"author": "kynetiv",
"description": "Adds a simple refresh button (tab) to the Devtools window.",
Expand Down
12 changes: 9 additions & 3 deletions refresh.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ chrome.devtools.panels.create("Refresh",
"refresh.html",
function(panel) {
panel.onShown.addListener(function(window){

// reload current page
chrome.devtools.inspectedWindow.reload({ignoreCache: true});
// no history of devtools' devtabs, so send back to elements tab
chrome.devtools.inspectedWindow.eval('inspect(window.document.body)');

chrome.tabs.onUpdated.addListener(function (tabId, changes, tabObject) {
if (changes.status == "complete") {
// no history of devtools' devtabs, so send back to elements tab after refresh is complete
chrome.devtools.inspectedWindow.eval('inspect(document.body)')
}
});
});
}
}gi
);

0 comments on commit 433e937

Please sign in to comment.