Skip to content

Commit b444312

Browse files
committed
1.17.10
Restore closed tab in Safari
1 parent f51a76c commit b444312

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Surfingkeys",
3-
"version": "1.17.9",
3+
"version": "1.17.10",
44
"description": "Map your keys for web surfing, expand your browser with javascript and keyboard.",
55
"main": "background.js",
66
"directories": {

src/background/start.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,13 @@ function start(browser) {
10151015
});
10161016
};
10171017
self.openLast = function(message, sender, sendResponse) {
1018-
chrome.sessions.restore();
1018+
if (browser.name === "Safari") {
1019+
chrome.runtime.sendNativeMessage("application.id", {command: "reopenLastTab"}, function(response) {
1020+
_response(message, sendResponse, response);
1021+
});
1022+
} else {
1023+
chrome.sessions.restore();
1024+
}
10191025
};
10201026
self.duplicateTab = function(message, sender, sendResponse) {
10211027
chrome.tabs.duplicate(sender.tab.id, function() {
@@ -1859,7 +1865,7 @@ function start(browser) {
18591865
};
18601866
self.readClipboard = function (message, sender, sendResponse) {
18611867
// only for Safari
1862-
chrome.runtime.sendNativeMessage("application.id", {message: "Clipboard.read"}, function(response) {
1868+
chrome.runtime.sendNativeMessage("application.id", {command: "Clipboard.read"}, function(response) {
18631869
_response(message, sendResponse, response);
18641870
});
18651871
};

src/content_scripts/common/default.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,10 @@ export default function(api, clipboard, insert, normal, hints, visual, front, br
821821
});
822822
}
823823

824+
mapkey('X', '#3Restore closed tab', function() {
825+
RUNTIME("openLast");
826+
});
827+
824828
if (!getBrowserName().startsWith("Safari")) {
825829
mapkey('t', '#8Open a URL', function() {
826830
front.openOmnibar({type: "URLs"});
@@ -831,9 +835,6 @@ export default function(api, clipboard, insert, normal, hints, visual, front, br
831835
mapkey('ox', '#8Open recently closed URL', function() {
832836
front.openOmnibar({type: "RecentlyClosed"});
833837
});
834-
mapkey('X', '#3Restore closed tab', function() {
835-
RUNTIME("openLast");
836-
});
837838
mapkey('b', '#8Open a bookmark', function() {
838839
front.openOmnibar(({type: "Bookmarks"}));
839840
});

0 commit comments

Comments
 (0)