-
Notifications
You must be signed in to change notification settings - Fork 50
RUN-5538 - Expose Find In Page #987
base: develop
Are you sure you want to change the base?
Conversation
Git
Asars used for testingTest results
|
src/browser/api/window.js
Outdated
@@ -1110,6 +1110,11 @@ Window.executeJavascript = function(identity, code, callback = () => {}) { | |||
WebContents.executeJavascript(browserWindow.webContents, code, callback); | |||
}; | |||
|
|||
Window.findInPage = function(identity, searchTerm, options) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually no, removing them now
Git
Asars used for testingTest results
|
Git
Asars used for testingTest results
|
Docs? |
Docs have been added to js-adapter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
const { payload } = message; | ||
const { searchTerm, options } = payload; | ||
const dataAck = Object.assign({}, successAck); | ||
const windowIdentity = getTargetWindowIdentity(payload); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Is there a reason we wouldn't want to use the identity
here instead of the payload
identity? Probably doesn't make a functional difference tho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the other functions are using the payload one, didn't see a need to change that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identity (First param) is the requesting identity, the identity in the payout is the target.
Will a findInPage action generate a single event or multiple? |
findInPage now returns a promise with the request results generated by the 'found-in-page' event. I've also left the event in as it could be useful as well. |
Git
Asars used for testingTest results
|
Description of Change
This exposes Electron's Find In Page API.
Checklist
npm test
passesTEST
Release Notes
Notes:
Added API to find and highlight text on a page.