From 63b93ce1ca16e93563453e5caba451886fa3c01d Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 18 Nov 2018 18:47:35 +0900 Subject: Use webextension message to console --- src/content/actions/find.js | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'src/content/actions/find.js') diff --git a/src/content/actions/find.js b/src/content/actions/find.js index b3d7e30..e08d7e5 100644 --- a/src/content/actions/find.js +++ b/src/content/actions/find.js @@ -9,25 +9,6 @@ import messages from 'shared/messages'; import actions from 'content/actions'; import * as consoleFrames from '../console-frames'; -const postPatternNotFound = (pattern) => { - return consoleFrames.postError( - window.document, - 'Pattern not found: ' + pattern); -}; - -const postPatternFound = (pattern) => { - return consoleFrames.postInfo( - window.document, - 'Pattern found: ' + pattern, - ); -}; - -const postNoPrevious = () => { - return consoleFrames.postError( - window.document, - 'No previous search keywords'); -}; - const find = (string, backwards) => { let caseSensitive = false; let wrapScan = true; @@ -60,13 +41,13 @@ const findNext = async(currentKeyword, reset, backwards) => { }); } if (!keyword) { - return postNoPrevious(); + return consoleFrames.postError('No previous search keywords'); } let found = find(keyword, backwards); if (found) { - postPatternFound(keyword); + consoleFrames.postInfo('Pattern found: ' + keyword); } else { - postPatternNotFound(keyword); + consoleFrames.postError('Pattern not found: ' + keyword); } return { -- cgit v1.2.3