Skip to content

Commit d0340c7

Browse files
committed
Add an optional parameter for devToolsExtension.open to choose position for DevTools window
Related to #16.
1 parent 5821cf6 commit d0340c7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/browser/extension/background/messaging.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ function messaging(request, sender, sendResponse) {
4444
return true;
4545
}
4646
if (request.type === 'OPEN') {
47-
openDevToolsWindow();
47+
let position = 'devtools-left';
48+
if (['panel', 'left', 'right', 'bottom'].indexOf(request.position) !== -1) position = 'devtools-' + request.position;
49+
openDevToolsWindow(position);
4850
return true;
4951
}
5052

src/browser/extension/inject/pageScript.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,10 @@ window.devToolsExtension = function(next) {
112112
};
113113
};
114114

115-
window.devToolsExtension.open = function() {
115+
window.devToolsExtension.open = function(position) {
116116
window.postMessage({
117117
source: 'redux-page',
118-
type: 'OPEN'
118+
type: 'OPEN',
119+
position: position || ''
119120
}, '*');
120121
};

0 commit comments

Comments
 (0)