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

[electron] fix resolution of hostname placeholder #7823

Merged
merged 1 commit into from
May 15, 2020

Conversation

akosyakov
Copy link
Member

@akosyakov akosyakov commented May 14, 2020

What it does

How to test

Review checklist

Reminder for reviewers

@akosyakov akosyakov added electron issues related to the electron target webviews issues related to webviews labels May 14, 2020
@marcdumais-work
Copy link
Contributor

I gave it a try and It did not work for me - still a blank page. No error or warning in either FE or BE logs.

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

I verified using a fresh build and despite removing the code as mentioned the webview still does not display any content when running on electron:

Screen Shot 2020-05-14 at 8 16 22 PM

@akosyakov
Copy link
Member Author

akosyakov commented May 15, 2020

Forbidden is for sure from this code. Are you sure that the core package recompiled after changes and the application is restarted?

Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
@akosyakov akosyakov force-pushed the akosyakov/webview-doesn-t-exist-7156 branch from f6449af to b50047b Compare May 15, 2020 07:42
@akosyakov
Copy link
Member Author

@marcdumais-work I've just realized that you are probably trying in Gitpod. The issue is that Gitpod is using custom webview hostname pattern which is not based on subdomains, such combination will never work in Electron. I've pushed a commit that make sure that in Electron we only use the default hostname patten which is based on localhost subdomains.

@akosyakov
Copy link
Member Author

akosyakov commented May 15, 2020

@marcdumais-work @vince-fugnitto my bad, you should comment out:

protected expressMiddleware(req: express.Request, res: express.Response, next: express.NextFunction): void {
if (this.tokenValidator.allowRequest(req)) {
next();
} else {
console.error(`refused an http request: ${req.connection.remoteAddress}`);
res.sendStatus(403);
}
}

🤦

Screenshot 2020-05-15 at 10 04 35

@akosyakov
Copy link
Member Author

btw there are still some issues with icons in Electron:
Screenshot 2020-05-15 at 10 05 12

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

I confirmed that when removing the token code the webview works successfully:
(the icons also show up in my case)

Screen Shot 2020-05-15 at 8 08 39 AM

@akosyakov
Copy link
Member Author

Merging, but someone has to have a look how to set a token for localhost subdomains as well.

@akosyakov akosyakov merged commit bb43e9e into master May 15, 2020
@akosyakov akosyakov deleted the akosyakov/webview-doesn-t-exist-7156 branch May 15, 2020 13:47
@marcdumais-work
Copy link
Contributor

@marcdumais-work I've just realized that you are probably trying in Gitpod. The issue is that Gitpod is using custom webview hostname pattern which is not based on subdomains, such combination will never work in Electron. I've pushed a commit that make sure that in Electron we only use the default hostname patten which is based on localhost subdomains.

Thanks @akosyakov - Indeed I was using Gitpod. There was another issue anyway so it would not have worked in any case. I just used Gitpod to test Paul's new PR. The demo Webview worked flawlessly with the new hostname pattern you set :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
electron issues related to the electron target webviews issues related to webviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants