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

Ionic 4: platform.is('electron') failed for electron 2.0.1 #14517

Closed
WolfWalter opened this issue May 22, 2018 · 2 comments
Closed

Ionic 4: platform.is('electron') failed for electron 2.0.1 #14517

WolfWalter opened this issue May 22, 2018 · 2 comments

Comments

@WolfWalter
Copy link

WolfWalter commented May 22, 2018

Bug Report

Ionic Info
Run ionic info from a terminal/cmd prompt and paste the output below.

cli packages: (/usr/lib/node_modules)

   @ionic/cli-utils  : 2.0.0-rc.6
   ionic (Ionic CLI) : 4.0.0-rc.6

local packages:

   @angular-devkit/core       : 0.6.0
   @angular-devkit/schematics : 0.6.0
   @angular/cli               : 6.0.3
   @ionic/schematics-angular  : 1.0.0-rc.6
   Ionic Framework            : @ionic/angular 4.0.0-alpha.7

System:

   NodeJS : v8.11.2
   npm    : 5.6.0
   OS     : Linux 4.15

Describe the Bug
When I tried to use this.platform.is('electron') inside electron with a ionic v4 app the result was negative.

Expected Behavior
Result should be true.

Additional Context
I checked the platform ionic source. https://github.com/ionic-team/ionic/blob/3bb661fa11e027f4cc55bd920d2353485beecff5/core/src/utils/platform.ts#L57 It is checked if the userAgent includes 'electron' but the electron 2.0.1 userAgent electron starts with a capital 'E':

win.navigator.userAgent:

"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko).../0.0.1 Chrome/61.0.3163.100 Electron/2.0.1 Safari/537.36"

@ionitron-bot ionitron-bot bot added the triage label May 22, 2018
@WolfWalter WolfWalter changed the title Ionic 3platform.is('electron') failed for electron 2.0.1 Ionic 4: platform.is('electron') failed for electron 2.0.1 May 23, 2018
@brandyscarney brandyscarney added this to the @ionic/core milestone Jul 5, 2018
@ionitron-bot ionitron-bot bot removed the triage label Jul 5, 2018
@brandyscarney
Copy link
Member

Thank you for the issue! I am going to close this issue and merge it into #15165 to keep all platform issues in one.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 13, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants