Skip to content

Commit 5dba973

Browse files
authored
docs: correct misleading tabOpenLink example (#2280)
1 parent 395f32b commit 5dba973

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

docs/API.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -623,10 +623,7 @@ Open links in new tabs.
623623
### Examples
624624

625625
```javascript
626-
mapkey("<Space>", "pause/resume on youtube", function() {
627-
var btn = document.querySelector("button.ytp-ad-overlay-close-button") || document.querySelector("button.ytp-ad-skip-button") || document.querySelector('ytd-watch-flexy button.ytp-play-button');
628-
btn.click();
629-
}, {domain: /youtube.com/i});
626+
tabOpenLink('https://github.com/brookhong/Surfingkeys')
630627
```
631628

632629
## insertJS

src/content_scripts/common/utils.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -871,11 +871,7 @@ function constructSearchURL(se, word) {
871871
* @param {string} str links to be opened, the links should be split by `\n` if there are more than one.
872872
* @param {number} [simultaneousness=5] how many tabs will be opened simultaneously, the rest will be queued and opened later whenever a tab is closed.
873873
*
874-
* @example
875-
* mapkey("<Space>", "pause/resume on youtube", function() {
876-
* var btn = document.querySelector("button.ytp-ad-overlay-close-button") || document.querySelector("button.ytp-ad-skip-button") || document.querySelector('ytd-watch-flexy button.ytp-play-button');
877-
* btn.click();
878-
* }, {domain: /youtube.com/i});
874+
* @example tabOpenLink('https://github.com/brookhong/Surfingkeys')
879875
*/
880876
function tabOpenLink(str, simultaneousness) {
881877
simultaneousness = simultaneousness || 5;

0 commit comments

Comments
 (0)