diff options
Diffstat (limited to 'src/content/actions/find.js')
-rw-r--r-- | src/content/actions/find.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/content/actions/find.js b/src/content/actions/find.js index c7345cc..249a8a9 100644 --- a/src/content/actions/find.js +++ b/src/content/actions/find.js @@ -22,6 +22,12 @@ const postPatternFound = (pattern) => { ); }; +const postNoPrevious = () => { + return consoleFrames.postError( + window.document, + 'No previous search keywords'); +}; + const find = (string, backwards) => { let caseSensitive = false; let wrapScan = true; @@ -50,6 +56,9 @@ const findNext = (currentKeyword, reset, backwards) => { } return promise.then((keyword) => { + if (!keyword) { + return postNoPrevious(); + } let found = find(keyword, backwards); if (!found) { window.getSelection().removeAllRanges(); |