Skip to content

Commit

Permalink
add command/shortcut to clear urls in queue.
Browse files Browse the repository at this point in the history
  • Loading branch information
brookhong committed Jan 3, 2024
1 parent 5f5e3e1 commit 79ff1b7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/background/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -1595,6 +1595,9 @@ function start(browser) {
queueURLs: _queueURLs
};
};
self.clearQueueURLs = function(message, sender, sendResponse) {
_queueURLs = [];
};

self.getVoices = function(message, sender, sendResponse) {
chrome.tts.getVoices(function(voices) {
Expand Down
3 changes: 3 additions & 0 deletions src/content_scripts/common/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ module.exports = function(api) {
});
}
});
mapkey(';cq', '#7Clear all URLs in queue to be opened', function() {
RUNTIME('clearQueueURLs');
});
mapkey('ys', "#7Copy current page's source", function() {
var aa = document.documentElement.cloneNode(true);
Clipboard.write(aa.outerHTML);
Expand Down
3 changes: 3 additions & 0 deletions src/content_scripts/ui/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ export default (normal, command, omnibar) => {
});
});
});
command('clearQueueURLs', 'clear URLs in queue waiting for open', function(args) {
RUNTIME('clearQueueURLs');
});
command('timeStamp', 'print time stamp in human readable format', function(args) {
var dt = new Date(parseInt(args[0]));
omnibar.listWords([dt.toString()]);
Expand Down
1 change: 1 addition & 0 deletions src/pages/l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"Change scroll target": "切换滚动目标",
"Choose a tab": "选择标签页",
"Chrome URLs": "Chrome内置功能",
"Clear all URLs in queue to be opened": "清除等待打开的URL",
"Click on an Image or a button": "点击图片或按钮",
"Click on node under cursor.": "点击光标下的元素",
"Click on the next link on current page": "点击当前页上的下一页链接",
Expand Down

0 comments on commit 79ff1b7

Please sign in to comment.