Skip to content
Permalink
Browse files

feat(platform): add mobileweb platform

  • Loading branch information...
liamdebeasi committed Feb 1, 2019
1 parent a415001 commit cf2b2b370a9d8aa1bfaf02e9031538d3af0af183
Showing with 7 additions and 1 deletion.
  1. +2 −1 angular/src/providers/platform.ts
  2. +5 −0 core/src/utils/platform.ts
@@ -98,8 +98,9 @@ export class Platform {
* | phablet | on a phablet device. |
* | tablet | on a tablet device. |
* | electron | in Electron on a desktop device. |
* | pwa | as a PWA app. |
* | pwa | as a PWA app. |
* | mobile | on a mobile device. |
* | mobileweb | on a mobile device in a browser. |
* | desktop | on a desktop device. |
* | hybrid | is a cordova or capacitor app. |
*
@@ -11,6 +11,7 @@ export const PLATFORMS_MAP = {
'electron': isElectron,
'pwa': isPWA,
'mobile': isMobile,
'mobileweb': isMobileWeb,
'desktop': isDesktop,
'hybrid': isHybrid
};
@@ -37,6 +38,10 @@ export function setupPlatforms(win: any) {
return platforms;
}

function isMobileWeb(win: Window): boolean {
return isMobile(win) && !isHybrid(win);
}

function detectPlatforms(win: Window): string[] {
return Object.keys(PLATFORMS_MAP).filter(p => (PLATFORMS_MAP as any)[p](win));
}

0 comments on commit cf2b2b3

Please sign in to comment.
You can’t perform that action at this time.