apache / cordova-plugin-splashscreen

Apache Cordova Plugin splashscreen
Apache License 2.0
643 stars 639 forks source link

Can not disable splash screen for browser platform #191

Open elitacco opened 5 years ago

elitacco commented 5 years ago

Bug Report

Problem

What is expected to happen?

Splash screen is disabled for browser platform using this configuration in config.xml:

<platform name="browser">
    <preference name="ShowSplashScreen" value="false" />
</platform>

as explained in the documentation: Browser quirks

What does actually happen?

The splash screen is still showing

Information

I'm using "cordova-browser": "6.0.0"

I think the problem is in : SplashScreenProxy.js

if (autoHideSplashScreen) {
            showAndHide();
        } else {
            SplashScreen.show();
        } 

If autoHideSplashScreen is "false" (I have it set to "false" for all the platforms. But if I try to override it for browser platform it does not work either) then it will try to show the splash screen even if "ShowSplashScreen" is false.

Command or Code

ionic cordova build browser

Environment, Platform, Device

Windows 10, Google Chrome browser Version 73.0.3683.103 (Official Build) (64-bit)

Version information

$ ionic info

Ionic:

   ionic (Ionic CLI)             : 4.12.0 (C:\Users\Eliseo Castilla\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.2.0
   @angular-devkit/build-angular : 0.13.8
   @angular-devkit/schematics    : 7.3.8
   @angular/cli                  : 7.3.8
   @ionic/angular-toolkit        : 1.5.1

Cordova:

   cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms     : browser 6.0.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.4.1, (and 11 other plugins)

System:

   Android SDK Tools : 26.1.1 (C:\Android\sdk)
   NodeJS            : v8.12.0 (C:\Program Files\nodejs\node.exe)
   npm               : 6.8.0
   OS                : Windows 10

Checklist

jakobkuehne commented 5 years ago

Same problem for me. I can't change the logo/background color or anything else on browser platform. (I can change, but no effect). So the Splashscreen always displays a missing image which is really ugly.

Thats why I wanted to disable the splash screen for browser platform. But as @elitacco says, without effect.

janpio commented 5 years ago

@jakobkuehne Could you please report these other problem you are seeing as individual issues? Otherwise this will get lost in here and never get fixed. Thanks.

jakobkuehne commented 5 years ago

Right now I am switching from VueJS to NuxtJS with VueJS. I will try that with NuxtJS in a few days (hopefully) and If I have the same problem there, I will report it as individual issue.

caiotarifa commented 5 years ago

Same problem here. Can't change any preference for browser platform!

caiotarifa commented 5 years ago

Related m0dch3n/vue-cli-plugin-cordova#70.

ThorvaldAagaard commented 5 years ago

Looking at the code it requires that you set autoHideSplashScreen to true, then ShowSplashScreen will be used, when deciding to show and hide the splashscreen.

If you set autoHideSplashScreen to false, splash will always be shown

agrinko commented 4 years ago

Thanks @ThorvaldAagaard , you helped! This worked for me to disable the splash screen:

    <platform name="browser">
        <preference name="AutoHideSplashScreen" value="true" />
        <preference name="ShowSplashScreen" value="false" />
    </platform>

I think the issue can be closed.

breautek commented 4 years ago

I think the issue can be closed.

I think this should be left open. One would think having <preference name="ShowSplashScreen" value="false" /> will be sufficient to not show the splashscreen. Requiring to also have <preference name="AutoHideSplashScreen" value="true" /> is confusing, doesn't make any real sense and probably a bug.

While the workaround works, I think the condition should be changed to be smarter so it doesn't assume that it should call SplashScreen.show(); when AutoHideSplashScreen is false. The condition should also consider looking at the ShowSplashScreen preference.

newbie78 commented 4 years ago

Thanks @ThorvaldAagaard , you helped! This worked for me to disable the splash screen:

    <platform name="browser">
        <preference name="AutoHideSplashScreen" value="true" />
        <preference name="ShowSplashScreen" value="false" />
    </platform>

I think the issue can be closed.

not worked for me

saeedvaziry commented 4 years ago

Any fixes for this?

Marcexl commented 3 years ago

Yeap the answer of @ThorvaldAagaard is simple 1) you need to add this

to your config.xml 2) run cordova buil browser 3) update files on your site 4) solved!