Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jspenguin2017 committed Dec 9, 2017
1 parent 9d31fd1 commit 547a6c0
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 9 deletions.
2 changes: 2 additions & 0 deletions platform/chromium/options_ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<meta charset="utf-8">
<script src="js/vapi.js"></script>
<script src="js/vapi-client.js"></script>
<!-- Patch 2017-12-09: Properly fix dashboard opening handling -->
<script src="js/vapi-nano.js"></script>
<script src="js/options_ui.js"></script>
<title></title>
</head>
Expand Down
9 changes: 0 additions & 9 deletions platform/chromium/vapi-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,15 +433,6 @@ vAPI.messaging.Connection.prototype = {

/******************************************************************************/

// Patch 2017-12-06: Replace the current tab
vAPI.openHere = function(path) {
if ( chrome.tabs !== undefined ) {
chrome.tabs.update({ url: path });
}
};

/******************************************************************************/

vAPI.shutdown.add(function() {
vAPI.messaging.shutdown();
window.vAPI = undefined;
Expand Down
21 changes: 21 additions & 0 deletions platform/chromium/vapi-nano.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict';

(function(self) {

/******************************************************************************/

// Patch 2017-12-06: Make dashboard full tab
vAPI.openHere = function(path) {
if ( chrome.tabs !== undefined ) {
chrome.tabs.update({ url: path });
}
};

/******************************************************************************/

// Patch 2017-12-09: Make back button properly return to extension manager
vAPI.extensionManager = 'chrome://extensions/';

/******************************************************************************/

})(this);
2 changes: 2 additions & 0 deletions src/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

<script src="js/vapi.js"></script>
<script src="js/vapi-common.js"></script>
<!-- Patch 2017-12-09: Properly fix dashboard opening handling -->
<script src="js/vapi-nano.js"></script>
<script src="js/udom.js"></script>
<script src="js/i18n.js"></script>
<script src="js/dashboard.js"></script>
Expand Down
7 changes: 7 additions & 0 deletions src/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,11 @@ uDom.onLoad(function() {

/******************************************************************************/

// Patch 2017-12-09: Make back button properly return to extension manager
window.addEventListener('beforeunload', function() {
vAPI.openHere(vAPI.extensionManager);
});

/******************************************************************************/

})();

0 comments on commit 547a6c0

Please sign in to comment.