pwa-builder / PWABuilder-CLI

Node.js tool for App Generation
Other
1.63k stars 142 forks source link

Opens Chrome browser on Android in-case there is any redirection from main URL #234

Closed bikashkumars closed 7 years ago

bikashkumars commented 7 years ago

Android Application has been build with Cordova v5.4.0 and Hosted-WebApp plugin v0.3.1. First the Application is hitting a to a URL and all the plugins are working there. But incase we are doing any redirection to a page, rather than doing the redirection in the same Android app instance it is opening Chrome browser and opening the application there with the NEW URL.

Our expected behaviours are. Our Web Application is hosted in mutliple URL. We can redirect from one URL to another URL based on business logic. All the cordova plugins should work evenIf we are playing with multiple URL in run time. Chrome browser should not get open due to URL redirection.

{ "name": "FSO MOBILE APP", "short_name": "Fsomobile", "mjs_cordova": { "plugin_mode": "client" }, "mjs_import_scripts": [ { "src": "css/bootstrap.min.css" }, { "src": "css/style.css" }, { "src": "js/supportedLibrary/jquery.min.js" }, { "src": "js/examples/audio-sample-source.js" }, { "src": "js/examples/video-sample-source.js" }, { "src": "js/examples/camera-sample-source.js" }, { "src": "js/examples/barcode-sample-source.js" }, { "src": "js/examples/common-sample-source.js" }, { "src": "js/examples/geolocation-sample-source.js" }, { "src": "js/examples/image-location-sample-source.js" }, { "src": "js/supportedLibrary/angular.min.js" }, { "src": "lib/html5.mobile.library.js" }, { "src": "js/controller/mainAppController.js" } ], "mjs_api_access": [ { "match": "*" } ], "start_url":"http://example.com/FSO2", "scope":"http://example.com/FSO2" "mjs_extended_scope":["https://rnam.otherdomain.net","https://login2.officedomain.net"] }

boyofgreen commented 7 years ago

This seems like an issue with the scope. Can you try adding the scopoe to just be "*", this isn't good practice, but it will set the scope to all URLs, and if it still pops out into the browser, then you know it is being done with JS on the page (like a window.open or taget="blank" etc)