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

fix: Monaco editor links opened in blank window in electron #4269

Merged
merged 3 commits into from
Sep 25, 2020

Conversation

zhixzhan
Copy link
Contributor

@zhixzhan zhixzhan commented Sep 25, 2020

Description

Monaco editor has option config to auto detect urls in text. ctrl + click on it will call vscode.open() -> window.open() open url.
Our current electron setting can handle <a target="_blank">open in browser</a>, but electron@8.2.4 seems has issue accept correct arguments. then we will see a empty page, case the accepted arguments url is about:blank.

Alternative solution

If we upgrade electron@10.1.1, the electron opened window would be correctly, but still failed to open in default browser.

Current solution

So before find a better way, current fix is disable link detecting in BaseEditor.text for electron environment.

Task Item

close #4070

Screenshots

Before (electron):

image

After (electron):

image

@coveralls
Copy link

coveralls commented Sep 25, 2020

Coverage Status

Coverage remained the same at 55.739% when pulling 64a7feb on zhixzhan/electron-open-link into 8ad58bd on main.

@cwhitten cwhitten merged commit 5155922 into main Sep 25, 2020
@cwhitten cwhitten deleted the zhixzhan/electron-open-link branch September 25, 2020 15:27
alanlong9278 added a commit to alanlong9278/BotFramework-Composer that referenced this pull request Sep 28, 2020
* main:
  fix: Monaco editor links opened in blank window in electron (microsoft#4269)
  feat: add notification center for composer (QnA url import) (microsoft#4080)
  fix: Object examples not properly displayed as placeholders (microsoft#4126)
  fix: allows spaces in bot project path (microsoft#4260)
  chore: extract build logic from components page (microsoft#4153)
@cwhitten cwhitten mentioned this pull request Nov 13, 2020
benbrown pushed a commit to benbrown/BotFramework-Composer that referenced this pull request May 24, 2021
* main:
  fix: Monaco editor links opened in blank window in electron (microsoft#4269)
  feat: add notification center for composer (QnA url import) (microsoft#4080)
  fix: Object examples not properly displayed as placeholders (microsoft#4126)
  fix: allows spaces in bot project path (microsoft#4260)
  chore: extract build logic from components page (microsoft#4153)
benbrown pushed a commit that referenced this pull request Jun 11, 2021
* main:
  fix: Monaco editor links opened in blank window in electron (#4269)
  feat: add notification center for composer (QnA url import) (#4080)
  fix: Object examples not properly displayed as placeholders (#4126)
  fix: allows spaces in bot project path (#4260)
  chore: extract build logic from components page (#4153)
lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
…t#4269)

* disable ctrl + click open window in electron

* do not use hasOwnProperty

* cast window to any

Co-authored-by: Andy Brown <asbrown002@gmail.com>
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.

[Electron ] When clicking an url in LG, it opens a strange window instead of default browser
4 participants