Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding an indexLoadOptions option #263

Merged
merged 1 commit into from
Jan 16, 2020

Conversation

adam-lynch
Copy link
Contributor

Resolves #262

The code changes are small. I updated the tests and docs. There were more changes than expected when updating the docs. Maybe someone forgot to commit them before... or maybe I shouldn't be running the command?

Copy link
Collaborator

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a bunch! This looks overall very good.

I only have two small changes

src/types.ts Outdated
* @default `{}`
* @see https://electronjs.org/docs/api/browser-window#winloadurlurl-options
*/
indexLoadOptions?: object;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of object, can we put the actual fields?

indexLoadOptions?: {
  userAgent?: string
  //etc
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actuall, there's a import { LoadURLOptions } from 'electron' already available.

On the same topic, could we rename indexLoadOptions to loadUrlOptions to keep the same naming as Electron?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, can do. I thought it would be hassle to keep it in sync.

Great if we can import it but I just tried to log LoadURLOptions and I got undefined. Where did you see that? I can't find anything online

Copy link
Collaborator

@amaury1093 amaury1093 Jan 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just tried to log LoadURLOptions

Yeah, it's a TypeScript interface, so doesn't have a JS value.

Where did you see that? I can't find anything online

It's generated from Electron docs by https://github.com/electron/typescript-definitions, so it's not really online. But you can search for LoadURLOptions in your local node_modules/electron/electron.d.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining. I'm new to TypeScript. That's handy.

@@ -0,0 +1,6648 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove this file? We use yarn in this repo

@adam-lynch
Copy link
Contributor Author

OK I think it's ready now

Copy link
Collaborator

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍 thanks!

@amaury1093 amaury1093 merged commit 8e6bd01 into max-mapper:master Jan 16, 2020
@adam-lynch adam-lynch deleted the index_load_options branch January 17, 2020 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: options to pass to window.loadUrl / userAgent option
2 participants