It would be cool if you could enable page search using CMD + F for apps. Would be very useful for wikis.
Electron does not support this, but it's possible with window.find().
+1 for this.
Find is something I use a lot in most web apps I use.
+1, I miss it on some apps
+1, really miss this : /
@jiahaog any suggestions for how to use window.find? I can get it to return true like so but it doesn't scroll or highlight or do anything useful:
> window.find('union')
true
I think you can use webContents.findInPageText()!
> webContents.findInPage('union')
Uncaught ReferenceError: webContents is not defined(…)
Maybe you need to use inspectServiceWorker() instead of toggleDevTools()?
I've been using a couple webapps (Asana, Harvest, Slack) wrapped in nativefier for a couple months now. I'm surprised how frequently (dozens of times per day) I try/need to use cmd-F to find something on the page and can't.
+1000 :)
On Mon, Oct 10, 2016 at 10:26 AM, Jon Brown [email protected]
wrote:
I've been using a couple webapps (Asana, Harvest, Slack) wrapped in
nativefier for a couple months now. I'm surprised how frequently (dozens of
times per day) I try/need to use cmd-F to find something on the page and
can't.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/jiahaog/nativefier/issues/29#issuecomment-252685362,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFwYRgNpFP3A2C_R-MDfyM-FbyPbLahQks5qynU7gaJpZM4HJVLj
.
This project looks abandoned, but if somehow it isn't, here's a ready-to-use electron package to add search in page: https://github.com/rhysd/electron-in-page-search
I'd LOVE this, its lack breaks many of my workflows : /
Hi, I tried Nativefier in Linux and would be great to use the search. Also installed the link above by @swrobel, and tried to compile the app again, but nothing changed.
How to use this in practice?
Wouldn't it make sense to have it compiled into Nativefier, without any external tools? (Simply put: why is this issue closed?)
"Wouldn't it make sense to have it compiled into Nativefier, without any external tools? (Simply put: why is this issue closed?)"
@binyominzeev the feature would make total sense, yes, PR welcome. We adjusted our triage rules, and indeed this issue shouldn't be closed, thanks for pointing it out 👍, re-opening.
Today alone I missed this feature on 3 different occasions...
On Tue, Aug 22, 2017 at 12:26 PM, Binyomin Szanto-Varnagy <
[email protected]> wrote:
Hi, I tried Nativefier in Linux and would be great to use the search. Also
installed the link above by @swrobel https://github.com/swrobel, and
tried to compile the app again, but nothing changed.How to use this in practice?
Wouldn't it make sense to have it compiled into Nativefier, without any
external tools? (Simply put: why is this issue closed?)—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/jiahaog/nativefier/issues/29#issuecomment-324127104,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFwYRinKqgOTptkN9SQ8LblFfhvFUkGmks5saytKgaJpZM4HJVLj
.
+1
Yup it's a desired feature, everybody knows it and the upvotes on the issue make it clear. Locking conversation to avoid "+1" comments and hiding existing "+1" comments. PR welcome 🙂.
I am active developing a PR for this issue if anyone would like to help.
I've got search about half working at the moment (get a search dialog to show up, performing a search, getting a match count) but running into a few snags (search box losing focus on input event, search matches no highlighting like they were when I began testing this at a lower level).
Right now I'm moving the search to it's own window like this project as there is a bit of overlap between that sample and what I'm trying to accomplish:
https://discuss.atom.io/t/using-webcontents-findinpage-to-implement-typical-find-function/25309/2
electron-find might be of interest.
I took a look at electron-find and the docs for --inject and started experimenting but couldn't figure out how to get electron-find to run as an injected script.
Are there any examples available of injected JS that accesses electron? I looked around but could not find anything other than trivial 'alert()' examples.
Below are a couple things I tried:
Minimal electron-find example, bundled with Browserify into a single .js file. (crapped out with: fs.existsSync is not a function, in function getElectronPath ())
const { remote, globalShortcut } = require("electron");
const { FindInPage } = require("electron-find");
const findInPage = new FindInPage(remote.getCurrentWebContents());
globalShortcut.register('Command+f', findInPage.openFindWindow);
After poking around in dev console, ran the following to try to figure out how to access electron from the injected js:
const preLoad = module.parent;
const children = preLoad.children;
const electron = children.filter(x => x.id === "electron")[0];
const {ipcRenderer} = electron.exports;
console.log("IPC RENDERER");
console.log(ipcRenderer);
const {remote} = require("electron");
console.log("REMOTE");
console.log(remote);
const {globalShortcut} = electron.exports;
console.log("GLOBAL SHORTCUT");
console.log(globalShortcut);
and wound up with below output in dev console - I found ipcRenderer but not remote or globalShortcut:

@eponymous301 see our Development guide to get yourself started hacking on Nativefier. This is not the job of an injected script.
Most helpful comment
Today alone I missed this feature on 3 different occasions...
On Tue, Aug 22, 2017 at 12:26 PM, Binyomin Szanto-Varnagy <
[email protected]> wrote: