aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview/find.js
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-08-13 00:45:01 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-08-13 00:45:01 +0530
commit2d27d5e66649d4f5baf127a53ee5ae524eae3a59 (patch)
treec592ea219ac8cd987fc367f57b54034c450ab2ab /src/webview/find.js
parentFerdi v5.6.0 (diff)
parent5.6.1-nightly.24 [skip ci] (diff)
downloadferdium-app-2d27d5e66649d4f5baf127a53ee5ae524eae3a59.tar.gz
ferdium-app-2d27d5e66649d4f5baf127a53ee5ae524eae3a59.tar.zst
ferdium-app-2d27d5e66649d4f5baf127a53ee5ae524eae3a59.zip
chore: merge from nightly branch into release branch in prep for next beta
Diffstat (limited to 'src/webview/find.js')
-rw-r--r--src/webview/find.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/webview/find.js b/src/webview/find.js
new file mode 100644
index 000000000..040811d68
--- /dev/null
+++ b/src/webview/find.js
@@ -0,0 +1,23 @@
1import { ipcRenderer } from 'electron';
2import { FindInPage as ElectronFindInPage } from 'electron-find';
3
4// Shim to expose webContents functionality to electron-find without @electron/remote
5const webContentsShim = {
6 findInPage: (text, options = {}) => ipcRenderer.sendSync('find-in-page', text, options),
7 stopFindInPage: (action) => {
8 ipcRenderer.sendSync('stop-find-in-page', action);
9 },
10 on: (eventName, listener) => {
11 if (eventName === 'found-in-page') {
12 ipcRenderer.on('found-in-page', (_, result) => {
13 listener({ sender: this }, result);
14 });
15 }
16 },
17};
18
19export default class FindInPage extends ElectronFindInPage {
20 constructor(options = {}) {
21 super(webContentsShim, options);
22 }
23}