├── .asf.yaml
├── .eslintrc.yml
├── .github
├── ISSUE_TEMPLATE.md
├── ISSUE_TEMPLATE
│ ├── BUG_REPORT.md
│ ├── FEATURE_REQUEST.md
│ └── SUPPORT_QUESTION.md
├── PULL_REQUEST_TEMPLATE.md
└── workflows
│ ├── chrome.yml
│ └── lint.yml
├── .gitignore
├── .npmignore
├── CONTRIBUTING.md
├── LICENSE
├── NOTICE
├── README.md
├── RELEASENOTES.md
├── package-lock.json
├── package.json
├── plugin.xml
├── src
└── browser
│ └── SplashScreenProxy.js
├── tests
├── package.json
├── plugin.xml
└── tests.js
├── types
└── index.d.ts
└── www
└── splashscreen.js
/.asf.yaml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | notifications:
19 | commits: commits@cordova.apache.org
20 | issues: issues@cordova.apache.org
21 | pullrequests_status: issues@cordova.apache.org
22 | pullrequests_comment: issues@cordova.apache.org
23 |
--------------------------------------------------------------------------------
/.eslintrc.yml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | root: true
19 | extends: '@cordova/eslint-config/browser'
20 |
21 | overrides:
22 | - files: [tests/**/*.js]
23 | extends: '@cordova/eslint-config/node-tests'
24 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
5 |
6 | ### Issue Type
7 |
8 |
9 | - [ ] Bug Report
10 | - [ ] Feature Request
11 | - [ ] Support Question
12 |
13 | ## Description
14 |
15 | ## Information
16 |
17 |
18 | ### Command or Code
19 |
20 |
21 | ### Environment, Platform, Device
22 |
23 |
24 |
25 |
26 | ### Version information
27 |
34 |
35 |
36 |
37 | ## Checklist
38 |
39 |
40 | - [ ] I searched for already existing GitHub issues about this
41 | - [ ] I updated all Cordova tooling to their most recent version
42 | - [ ] I included all the necessary information above
43 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/BUG_REPORT.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 🐛 Bug Report
3 | about: If something isn't working as expected.
4 |
5 | ---
6 |
7 | # Bug Report
8 |
9 | ## Problem
10 |
11 | ### What is expected to happen?
12 |
13 |
14 |
15 | ### What does actually happen?
16 |
17 |
18 |
19 | ## Information
20 |
21 |
22 |
23 |
24 | ### Command or Code
25 |
26 |
27 |
28 |
29 | ### Environment, Platform, Device
30 |
31 |
32 |
33 |
34 | ### Version information
35 |
42 |
43 |
44 |
45 | ## Checklist
46 |
47 |
48 | - [ ] I searched for existing GitHub issues
49 | - [ ] I updated all Cordova tooling to most recent version
50 | - [ ] I included all the necessary information above
51 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 🚀 Feature Request
3 | about: A suggestion for a new functionality
4 |
5 | ---
6 |
7 | # Feature Request
8 |
9 | ## Motivation Behind Feature
10 |
11 |
12 |
13 |
14 | ## Feature Description
15 |
20 |
21 |
22 |
23 | ## Alternatives or Workarounds
24 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 💬 Support Question
3 | about: If you have a question, please check out our Slack or StackOverflow!
4 |
5 | ---
6 |
7 |
8 |
9 | Apache Cordova uses GitHub Issues as a feature request and bug tracker _only_.
10 | For usage and support questions, please check out the resources below. Thanks!
11 |
12 | ---
13 |
14 | You can get answers to your usage and support questions about **Apache Cordova** on:
15 |
16 | * Slack Community Chat: https://cordova.slack.com (you can sign-up at http://slack.cordova.io/)
17 | * StackOverflow: https://stackoverflow.com/questions/tagged/cordova using the tag `cordova`
18 |
19 | ---
20 |
21 | If you are using a tool that uses Cordova internally, like e.g. Ionic, check their support channels:
22 |
23 | * **Ionic Framework**
24 | * [Ionic Community Forum](https://forum.ionicframework.com/)
25 | * [Ionic Worldwide Slack](https://ionicworldwide.herokuapp.com/)
26 | * **PhoneGap**
27 | * [PhoneGap Developer Community](https://forums.adobe.com/community/phonegap)
28 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
8 |
9 | ### Platforms affected
10 |
11 |
12 |
13 | ### Motivation and Context
14 |
15 |
16 |
17 |
18 |
19 | ### Description
20 |
21 |
22 |
23 |
24 | ### Testing
25 |
26 |
27 |
28 |
29 | ### Checklist
30 |
31 | - [ ] I've run the tests to see all new and existing tests pass
32 | - [ ] I added automated test coverage as appropriate for this change
33 | - [ ] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
34 | - [ ] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
35 | - [ ] I've updated the documentation if necessary
36 |
--------------------------------------------------------------------------------
/.github/workflows/chrome.yml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | name: Chrome Testsuite
19 |
20 | on:
21 | push:
22 | paths-ignore:
23 | - '**.md'
24 | - 'LICENSE'
25 | - '.eslint*'
26 | pull_request:
27 | paths-ignore:
28 | - '**.md'
29 | - 'LICENSE'
30 | - '.eslint*'
31 |
32 | jobs:
33 | test:
34 | name: Chrome Latest Test
35 | runs-on: ubuntu-latest
36 |
37 | # hoist configurations to top that are expected to be updated
38 | env:
39 | # Storing a copy of the repo
40 | repo: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
41 |
42 | node-version: 16
43 |
44 | steps:
45 | - uses: actions/checkout@v2
46 | - uses: actions/setup-node@v2
47 | with:
48 | node-version: ${{ env.node-version }}
49 |
50 | - name: Run install xvfb
51 | run: sudo apt-get install xvfb
52 |
53 | - name: Run Environment Information
54 | run: |
55 | node --version
56 | npm --version
57 |
58 | - name: Run npm install
59 | run: |
60 | npm i -g cordova@latest
61 | npm ci
62 |
63 | - name: Run paramedic install
64 | if: ${{ endswith(env.repo, '/cordova-paramedic') != true }}
65 | run: npm i -g github:apache/cordova-paramedic
66 |
67 | - name: Run paramedic tests
68 | env:
69 | test_config: 'browser.config.json'
70 | # Generally, this should automatically work for cordova-paramedic & plugins. If the path is unique, this can be manually changed.
71 | test_plugin_path: ${{ endswith(env.repo, '/cordova-paramedic') && './spec/testable-plugin/' || './' }}
72 | paramedic: ${{ endswith(env.repo, '/cordova-paramedic') && 'node main.js' || 'cordova-paramedic' }}
73 | run: xvfb-run --auto-servernum ${{ env.paramedic }} --config ./pr/local/${{ env.test_config }} --plugin ${{ env.test_plugin_path }}
74 |
--------------------------------------------------------------------------------
/.github/workflows/lint.yml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | name: Lint Test
19 |
20 | on:
21 | push:
22 | paths:
23 | - '**.js'
24 | - '.eslint*'
25 | - '.github/workflow/lint.yml'
26 | pull_request:
27 | paths:
28 | - '**.js'
29 | - '.eslint*'
30 | - '.github/workflow/lint.yml'
31 |
32 | jobs:
33 | test:
34 | name: Lint Test
35 | runs-on: ubuntu-latest
36 | env:
37 | node-version: 16
38 |
39 | steps:
40 | - uses: actions/checkout@v2
41 | - uses: actions/setup-node@v2
42 | with:
43 | node-version: ${{ env.node-version }}
44 |
45 | - name: Run Environment Information
46 | run: |
47 | node --version
48 | npm --version
49 |
50 | - name: Run npm install
51 | run: |
52 | npm ci
53 |
54 | - name: Run lint test
55 | run: |
56 | npm run lint
57 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #If ignorance is bliss, then somebody knock the smile off my face
2 |
3 | *.csproj.user
4 | *.suo
5 | *.cache
6 | Thumbs.db
7 | *.DS_Store
8 |
9 | *.bak
10 | *.cache
11 | *.log
12 | *.swp
13 | *.user
14 |
15 | node_modules
16 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .*
2 | tests
3 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 |
21 |
22 | # Contributing to Apache Cordova
23 |
24 | Anyone can contribute to Cordova. And we need your contributions.
25 |
26 | There are multiple ways to contribute: report bugs, improve the docs, and
27 | contribute code.
28 |
29 | For instructions on this, start with the
30 | [contribution overview](http://cordova.apache.org/contribute/).
31 |
32 | The details are explained there, but the important items are:
33 | - Check for Github issues that corresponds to your contribution and link or create them if necessary.
34 | - Run the tests so your patch doesn't break existing functionality.
35 |
36 | We look forward to your contributions!
37 |
38 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright [yyyy] [name of copyright owner]
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
--------------------------------------------------------------------------------
/NOTICE:
--------------------------------------------------------------------------------
1 | Apache Cordova
2 | Copyright 2012 The Apache Software Foundation
3 |
4 | This product includes software developed at
5 | The Apache Software Foundation (http://www.apache.org/).
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Browser Splashscreen
3 | description: Control the browser platform splash screen for your app.
4 | ---
5 |
23 |
24 | # cordova-plugin-splashscreen
25 |
26 | [](https://github.com/apache/cordova-plugin-splashscreen/actions/workflows/chrome.yml) [](https://github.com/apache/cordova-plugin-splashscreen/actions/workflows/lint.yml)
27 |
28 | This plugin displays and hides a splash screen while your web application is launching. Using its methods you can also show and hide the splash screen manually.
29 |
30 | - [cordova-plugin-splashscreen](#cordova-plugin-splashscreen)
31 | - [Installation](#installation)
32 | - [Supported Platforms](#supported-platforms)
33 | - [Platform Splash Screen Image Configuration](#platform-splash-screen-image-configuration)
34 | - [Example Configuration](#example-configuration)
35 | - [Preferences](#preferences)
36 | - [config.xml](#configxml)
37 | - [Quirks](#quirks)
38 | - [Methods](#methods)
39 | - [splashscreen.hide](#splashscreenhide)
40 | - [splashscreen.show](#splashscreenshow)
41 |
42 | ## Installation
43 |
44 | // npm hosted (new) id
45 | cordova plugin add cordova-plugin-splashscreen
46 |
47 | // you may also install directly from this repo
48 | cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git
49 |
50 | ## Supported Platforms
51 |
52 | - Browser
53 |
54 | ## Platform Splash Screen Image Configuration
55 |
56 | ### Example Configuration
57 |
58 | In the top-level `config.xml` file (not the one in `platforms`), add configuration elements like those specified here.
59 |
60 | The value of the "src" attribute is relative to the project root directory and NOT to the `www` directory (see `Directory structure` below). You can name the source image file whatever you like. The internal name in the application is automatically determined by Cordova.
61 |
62 | Directory structure:
63 |
64 | ```
65 | projectRoot
66 | hooks
67 | platforms
68 | plugins
69 | www
70 | css
71 | img
72 | js
73 | res
74 | screen
75 | ```
76 |
77 | ```xml
78 |
79 | ```
80 |
81 | ## Preferences
82 |
83 | ### config.xml
84 |
85 | - `AutoHideSplashScreen` (boolean, default to `true`). Indicates whether to hide splash screen automatically or not. The splash screen is hidden after the amount of time specified in the `SplashScreenDelay` preference.
86 |
87 | ```xml
88 |
89 | ```
90 |
91 | - `SplashScreenDelay` (number, default to 3000). Amount of time in milliseconds to wait before automatically hide splash screen.
92 |
93 | ```xml
94 |
95 | ```
96 |
97 | This value used to be in seconds (but is now milliseconds) so values less than 30 will continue to be treated as seconds. (Consider this a deprecated patch that will disapear in some future version.)
98 |
99 | To disable the splashscreen add the following preference to `config.xml`:
100 | ```xml
101 |
102 | ```
103 |
104 | - `FadeSplashScreen` (boolean, defaults to `true`): Set to `false` to
105 | prevent the splash screen from fading in and out when its display
106 | state changes.
107 |
108 | ```xml
109 |
110 | ```
111 |
112 | - `FadeSplashScreenDuration` (float, defaults to `500`): Specifies the
113 | number of milliseconds for the splash screen fade effect to execute.
114 |
115 | ```xml
116 |
117 | ```
118 |
119 | _Note_: `FadeSplashScreenDuration` is included into `SplashScreenDelay`, for example if you have `` and `` defined in `config.xml`:
120 |
121 | - 00:00 - splashscreen is shown
122 | - 00:02 - fading has started
123 | - 00:03 - splashscreen is hidden
124 |
125 | Turning the fading off via `` technically means fading duration to be `0` so that in this example the overall splash screen delay will still be 3 seconds.
126 |
127 | _Note_: This only applies to the application startup - you need to take the fading timeout into account when manually showing/hiding the splash screen in your application's code:
128 |
129 | ```javascript
130 | navigator.splashscreen.show();
131 | window.setTimeout(function () {
132 | navigator.splashscreen.hide();
133 | }, splashDuration - fadeDuration);
134 | ```
135 |
136 | ### Quirks
137 |
138 | You can use the following preferences in your `config.xml`:
139 |
140 | ```xml
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 | ```
151 |
152 | __Note__: `SplashScreen` value should be absolute in order to work in a sub-page.
153 |
154 | ## Methods
155 |
156 | - splashscreen.show
157 | - splashscreen.hide
158 |
159 | ### splashscreen.hide
160 |
161 | Dismiss the splash screen.
162 |
163 | ```js
164 | navigator.splashscreen.hide();
165 | ```
166 |
167 | ### splashscreen.show
168 |
169 | Displays the splash screen.
170 |
171 | ```js
172 | navigator.splashscreen.show();
173 | ```
174 |
175 | Your application cannot call `navigator.splashscreen.show()` until the application has
176 | started and the `deviceready` event has fired. But since typically the splash
177 | screen is meant to be visible before your application has started, that would seem to
178 | defeat the purpose of the splash screen. Providing any parameters in
179 | `config.xml` will automatically `show` the splash screen immediately after your
180 | application is launched and before it has fully started and received the `deviceready`
181 | event. For this reason, it is unlikely you will need to call `navigator.splashscreen.show()` to make the splash
182 | screen visible for application startup.
183 |
--------------------------------------------------------------------------------
/RELEASENOTES.md:
--------------------------------------------------------------------------------
1 |
21 | # Release Notes
22 |
23 | ### 6.0.2 (Jul 12, 2022)
24 |
25 | * [GH-331](https://github.com/apache/cordova-plugin-splashscreen/pull/331) doc(ios): remove docs from `README` (migrated to cordova-docs)
26 | * [GH-329](https://github.com/apache/cordova-plugin-splashscreen/pull/329) chore(android): update **Android** engine requirement `<11.0.0`
27 | * [GH-327](https://github.com/apache/cordova-plugin-splashscreen/pull/327) docs: fixup spaces for releasnotes
28 | * [GH-326](https://github.com/apache/cordova-plugin-splashscreen/pull/326) chore(CI): remove **iOS** workflow
29 |
30 | ### 6.0.1 (Apr 04, 2022)
31 | * [GH-325](https://github.com/apache/cordova-plugin-splashscreen/pull/325) chore: update package-lock.json
32 | * [GH-213](https://github.com/apache/cordova-plugin-splashscreen/pull/213) GH-180 (android): Fixes nav and title bars still appearing when app is fullscreen
33 | * [GH-320](https://github.com/apache/cordova-plugin-splashscreen/pull/320) ci(ios): update workflow w/ **iOS** 15
34 | * [GH-319](https://github.com/apache/cordova-plugin-splashscreen/pull/319) ci: add action-badge
35 | * [GH-318](https://github.com/apache/cordova-plugin-splashscreen/pull/318) ci: remove travis & appveyor
36 | * [GH-317](https://github.com/apache/cordova-plugin-splashscreen/pull/317) ci: add gh-actions workflows
37 | * [GH-312](https://github.com/apache/cordova-plugin-splashscreen/pull/312) fix: autofocus after splashscreen
38 | * [GH-314](https://github.com/apache/cordova-plugin-splashscreen/pull/314) fix: refocus after webview visible (#186)
39 | * [GH-304](https://github.com/apache/cordova-plugin-splashscreen/pull/304) ci: add node-14.x to workflow
40 | * [GH-291](https://github.com/apache/cordova-plugin-splashscreen/pull/291) chore(docs): Update missing default resources for **Android** #689
41 | * [GH-293](https://github.com/apache/cordova-plugin-splashscreen/pull/293) Documentation Enhancement for **Android** Dark Mode
42 | * [GH-300](https://github.com/apache/cordova-plugin-splashscreen/pull/300) docs: Added **iOS** notes to supported platforms.
43 | * [GH-296](https://github.com/apache/cordova-plugin-splashscreen/pull/296) chore(pkg): remove default-valued field "homepage"
44 | * [GH-292](https://github.com/apache/cordova-plugin-splashscreen/pull/292) ci(travis): updates **Android** API level
45 | * [GH-286](https://github.com/apache/cordova-plugin-splashscreen/pull/286) (docs): Add Information about how to use Dark Mode SplashScreens
46 |
47 | ### 6.0.0 (Jul 07, 2020)
48 |
49 | * [GH-282](https://github.com/apache/cordova-plugin-splashscreen/pull/282) fix: js `clobber` only on supported platforms
50 | * [GH-281](https://github.com/apache/cordova-plugin-splashscreen/pull/281) chore: adds `package-lock` file
51 | * [GH-280](https://github.com/apache/cordova-plugin-splashscreen/pull/280) doc(android): various improvements including size specs
52 | * [GH-200](https://github.com/apache/cordova-plugin-splashscreen/pull/200) fix(windows): implementation structure
53 | * [GH-279](https://github.com/apache/cordova-plugin-splashscreen/pull/279) chore: add missing supported platform **Browser** to `npm` keywords
54 | * [GH-278](https://github.com/apache/cordova-plugin-splashscreen/pull/278) chore: update `engine` checks to cover newer versions
55 | * [GH-277](https://github.com/apache/cordova-plugin-splashscreen/pull/277) breaking: replace `jshint` with `eslint`
56 | * [GH-276](https://github.com/apache/cordova-plugin-splashscreen/pull/276) breaking: drop `node` `engine` requirement
57 | * [GH-275](https://github.com/apache/cordova-plugin-splashscreen/pull/275) chore: cleanup repo
58 | * [GH-274](https://github.com/apache/cordova-plugin-splashscreen/pull/274) breaking: bump `engine` restriction for cordova dependencies
59 | * [GH-263](https://github.com/apache/cordova-plugin-splashscreen/pull/263) breaking: remove **iOS** platform code from plugin repo
60 | * [GH-267](https://github.com/apache/cordova-plugin-splashscreen/pull/267) test: force `cordova-ios`@^5.1.1
61 |
62 | ### 5.0.4 (Jun 03, 2020)
63 | * [GH-261](https://github.com/apache/cordova-plugin-splashscreen/pull/261) chore: add `cordova-ios` requirement <6.0.0
64 | * chore(asf): update git notification settings
65 | * update CONTRIBUTING.md
66 | * [GH-251](https://github.com/apache/cordova-plugin-splashscreen/pull/251) chore(npm): adds ignore list
67 | * [GH-252](https://github.com/apache/cordova-plugin-splashscreen/pull/252) ci: updates Node.js versions
68 | * [GH-236](https://github.com/apache/cordova-plugin-splashscreen/pull/236) update homepage to github `README` page
69 | * [GH-239](https://github.com/apache/cordova-plugin-splashscreen/pull/239) update `README`.md by adding missing info
70 | * ci(travis): Upgrade node from 6 to 8
71 | * ci(travis): Remove **Android 4.4**, Add **Android** 9.0
72 | * [GH-212](https://github.com/apache/cordova-plugin-splashscreen/pull/212) ci(travis): Add ADDITIONAL_TESTS_DIR=./tests/ios
73 |
74 | ### 5.0.3 (May 09, 2019)
75 | * Update CI configuration and README ([#210](https://github.com/apache/cordova-plugin-splashscreen/pull/210), [#208](https://github.com/apache/cordova-plugin-splashscreen/pull/208), [#198](https://github.com/apache/cordova-plugin-splashscreen/pull/198), [#194](https://github.com/apache/cordova-plugin-splashscreen/pull/194))
76 | * Add or update GitHub pull request and issue template
77 | * [CB-13826](https://issues.apache.org/jira/browse/CB-13826) Incremented plugin version.
78 | * [CB-12277](https://issues.apache.org/jira/browse/CB-12277) (android) avoid NullPointerException on splashImageView when removing splashscreen
79 |
80 | ### 5.0.2 (Jan 24, 2018)
81 | * [CB-13750](https://issues.apache.org/jira/browse/CB-13750) Add build-tools-26.0.2 to travis
82 | * [CB-13737](https://issues.apache.org/jira/browse/CB-13737) (iOS): fix Splash screen images for iPhone X
83 |
84 | ### 5.0.1 (Dec 27, 2017)
85 | * [CB-13709](https://issues.apache.org/jira/browse/CB-13709) Fix to allow 5.0.0 version install (#144)
86 |
87 | ### 5.0.0 (Dec 15, 2017)
88 | * [CB-13677](https://issues.apache.org/jira/browse/CB-13677) Remove deprecated platforms
89 |
90 | ### 4.1.0 (Nov 06, 2017)
91 | * [CB-13473](https://issues.apache.org/jira/browse/CB-13473) (CI) Removed **Browser** builds from AppVeyor
92 | * [CB-12011](https://issues.apache.org/jira/browse/CB-12011) (android) added the possibility to change the spinner color on **Android 5.0**+ apps
93 | * [CB-13028](https://issues.apache.org/jira/browse/CB-13028) (CI) **Browser** builds on Travis and AppVeyor
94 | * [CB-13094](https://issues.apache.org/jira/browse/CB-13094) (android) Don't show splash when activity being finished
95 | * [CB-11487](https://issues.apache.org/jira/browse/CB-11487) (browser) Documented `AutoHideSplashScreen` for **Browser**
96 | * [CB-11488](https://issues.apache.org/jira/browse/CB-11488) (browser) The `hide()` call became non re-entrant after the addition of fade out. This fixes the issue.
97 | * [CB-11487](https://issues.apache.org/jira/browse/CB-11487) (browser) The standard `AutoHideSplashScreen` `config.xml` property is now supported by the **Browser** platform.
98 | * [CB-11486](https://issues.apache.org/jira/browse/CB-11486) (browser) `splashScreenDelay` now feed through `parseInt` to ensure it is an integer by the time it's value is passed in to `setTimeout()` in `hide()`.
99 | * [CB-12847](https://issues.apache.org/jira/browse/CB-12847) added `bugs` entry to `package.json`.
100 |
101 | ### 4.0.3 (Apr 27, 2017)
102 | * [CB-12622](https://issues.apache.org/jira/browse/CB-12622) Added **Android 6.0** build badge to `README`
103 | * [CB-12685](https://issues.apache.org/jira/browse/CB-12685) added `package.json` to tests folder
104 |
105 | ### 4.0.2 (Feb 28, 2017)
106 | * [CB-12353](https://issues.apache.org/jira/browse/CB-12353) Corrected merges usage in `plugin.xml`
107 | * [CB-12369](https://issues.apache.org/jira/browse/CB-12369) Add plugin typings from `DefinitelyTyped`
108 | * [CB-12363](https://issues.apache.org/jira/browse/CB-12363) Added build badges for **iOS 9.3** and **iOS 10.0**
109 | * [CB-12230](https://issues.apache.org/jira/browse/CB-12230) Removed **Windows 8.1** build badges
110 |
111 | ### 4.0.1 (Dec 07, 2016)
112 | * [CB-12224](https://issues.apache.org/jira/browse/CB-12224) Updated version and RELEASENOTES.md for release 4.0.1
113 | * [CB-11751](https://issues.apache.org/jira/browse/CB-11751) 'extendedSplashScreen' is undefined Document that splashscreen needs to be disabled on Windows in case of updating entire document body
114 | * [CB-9287](https://issues.apache.org/jira/browse/CB-9287) Not enough Icons and Splashscreens for **Windows 8.1** and Windows Phone 8.1
115 | * [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been submitted…"
116 | * [CB-11830](https://issues.apache.org/jira/browse/CB-11830) (iOS) Fix doc typos in PR#114
117 | * [CB-11829](https://issues.apache.org/jira/browse/CB-11829) (iOS) Support for CB-9762; docs (CB-11830)
118 | * [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Incremented plugin version.
119 |
120 | ### 4.0.0 (Sep 08, 2016)
121 | * [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies
122 | * [CB-11326](https://issues.apache.org/jira/browse/CB-11326) Prevent crash when initializing plugin after navigating to another URL
123 | * Fix crash on **iOS** when reloading page from remote **Safari**
124 | * Add badges for paramedic builds on Jenkins
125 | * Add pull request template.
126 | * [CB-11179](https://issues.apache.org/jira/browse/CB-11179) Extend the windows-splashscreen docs
127 | * [CB-11159](https://issues.apache.org/jira/browse/CB-11159) Fix flaky splashscreen native tests
128 | * [CB-11156](https://issues.apache.org/jira/browse/CB-11156) Change default `FadeSplashScreenDuration` value
129 | * [CB-8056](https://issues.apache.org/jira/browse/CB-8056) Updated the dependency version, added it to the docs
130 | * [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to README.md
131 | * [CB-8056](https://issues.apache.org/jira/browse/CB-8056) Implement splashscreen for **Windows** platform
132 | * [CB-6498](https://issues.apache.org/jira/browse/CB-6498) Misleading documentation in **Android** Quirks
133 |
134 | ### 3.2.2 (Apr 15, 2016)
135 | * [CB-10979](https://issues.apache.org/jira/browse/CB-10979) Fix splashscreen **iOS** native tests. Added `jshintignore` for tests/ios
136 | * [CB-10895](https://issues.apache.org/jira/browse/CB-10895) Transparent Splashscreen view sometimes remains
137 | * [CB-10562](https://issues.apache.org/jira/browse/CB-10562) `hide()` not working in latest splashscreen plug in 3.1.0 in **iOS**
138 | * [CB-10688](https://issues.apache.org/jira/browse/CB-10688) Plugin Splashscreen Readme must have examples.
139 | * [CB-10864](https://issues.apache.org/jira/browse/CB-10864) Run **iOS** native tests on Travis
140 |
141 | ### 3.2.1 (Mar 09, 2016)
142 | * [CB-10764](https://issues.apache.org/jira/browse/CB-10764) Remove emoji in cordova-plugin-splashscreen
143 | * [CB-10650](https://issues.apache.org/jira/browse/CB-10650) Non-index content.src causes Splashscreen to be not displayed on **Browser**
144 | * [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add JSHint for plugins
145 | * [CB-10606](https://issues.apache.org/jira/browse/CB-10606) fix deprecation warning for interfaceOrientation on **iOS**
146 | * chore: edit package.json license to match SPDX id
147 |
148 | ### 3.2.0 (Feb 09, 2016)
149 | * [CB-10422](https://issues.apache.org/jira/browse/CB-10422) Splashscreen displays black screen with no image on Android
150 | * [CB-10412](https://issues.apache.org/jira/browse/CB-10412) AutoHideSplashScreen "false" isn't taken in account on iOS
151 | * [CB-9516](https://issues.apache.org/jira/browse/CB-9516) Android SplashScreen - Spinner Does Not Display
152 | * [CB-9094](https://issues.apache.org/jira/browse/CB-9094) Smarter autohide logic on Android
153 | * [CB-8396](https://issues.apache.org/jira/browse/CB-8396) Add AutoHideSplashScreen logic to Android's Splashscreen
154 |
155 | ### 3.1.0 (Jan 15, 2016)
156 | * [CB-9538](https://issues.apache.org/jira/browse/CB-9538) Implementing `FadeSplashScreen` feature for **Android**
157 | * [CB-9240](https://issues.apache.org/jira/browse/CB-9240) Cordova splash screen plugin **iPad** landscape mode issue
158 | * [CB-10263](https://issues.apache.org/jira/browse/CB-10263) Fix splashscreen plugin filenames for Asset Catalog
159 | * [CB-9374](https://issues.apache.org/jira/browse/CB-9374) **Android** add `SplashShowOnlyFirstTime` as preference
160 | * [CB-10244](https://issues.apache.org/jira/browse/CB-10244) Don't rotate the **iPhone 6 Plus** splash
161 | * [CB-9043](https://issues.apache.org/jira/browse/CB-9043) Fix the **ios** splashscreen being deformed on orientation change
162 | * [CB-10079](https://issues.apache.org/jira/browse/CB-10079) Splashscreen plugin does not honor `SplashScreenDelay` on **iOS**
163 | * [CB-10231](https://issues.apache.org/jira/browse/CB-10231) Fix `FadeSplashScreen` to default to true on **iOS**
164 |
165 | ### 3.0.0 (Nov 18, 2015)
166 | * [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
167 | * Fixing contribute link.
168 | * [CB-9750](https://issues.apache.org/jira/browse/CB-9750) `FadeSplashDuration` is now in `msecs`
169 | * [CB-8875](https://issues.apache.org/jira/browse/CB-8875) `FadeSplashScreen` was not fading
170 | * [CB-9467](https://issues.apache.org/jira/browse/CB-9467) SplashScreen does not show any image in hosted app on **Windows 10**
171 | * [CB-7282](https://issues.apache.org/jira/browse/CB-7282) Document `AutoHideSplashScreenpreference`
172 | * [CB-9327](https://issues.apache.org/jira/browse/CB-9327) - Splashscreen not receiving `CDVPageLoadNotification`
173 | * WP8: Avoid config `value` of a wrong element.
174 |
175 | ### 2.1.0 (Jun 17, 2015)
176 | * added missing license headers
177 | * [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen
178 | * fix npm md issue
179 | * Fixed iOS unit tests.
180 | * [CB-3562](https://issues.apache.org/jira/browse/CB-3562): Disable screen rotation for iPhone when splash screen is shown. (closes #47)
181 | * [CB-8988](https://issues.apache.org/jira/browse/CB-8988): Fix rotation on iOS/iPad (closes #46)
182 | * [CB-8904](https://issues.apache.org/jira/browse/CB-8904): Don't reset the static variable when it's destroyed, otherwise we might as well just have a member variable
183 | * Removed wp7 from `plugin.xml` and package.json
184 | * [CB-8750](https://issues.apache.org/jira/browse/CB-8750) [wp8]: Rewrite resoultion helper
185 | * [CB-8750](https://issues.apache.org/jira/browse/CB-8750) [wp8]: Allow resolution-specific splashscreen images
186 | * [CB-8758](https://issues.apache.org/jira/browse/CB-8758) [wp8]: UnauthorizedAccessException on hide()
187 |
188 | ### 2.0.0 (Apr 15, 2015)
189 | * give users a way to install the bleeding edge.
190 | * [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump
191 | * [CB-8797](https://issues.apache.org/jira/browse/CB-8797) - Splashscreen preferences FadeSplashScreenDuration and FadeSplashScreen (iOS) are missing
192 | * [CB-8836](https://issues.apache.org/jira/browse/CB-8836) - Crashes after animating splashscreen
193 | * [CB-8753](https://issues.apache.org/jira/browse/CB-8753) android: Fix missing import in previous commit
194 | * [CB-8753](https://issues.apache.org/jira/browse/CB-8753) android: Adds `SplashMaintainAspectRatio` preference (close #43)
195 | * [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name
196 | * [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id
197 | * [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id
198 | * [CB-8345](https://issues.apache.org/jira/browse/CB-8345) Make default for splashscreen resource "screen" (which is what template and CLI assume it to be)
199 | * Revert "CB-8345 android: Make "splash" the default resource ID instead of null"
200 | * Use TRAVIS_BUILD_DIR, install paramedic by npm
201 | * [CB-8345](https://issues.apache.org/jira/browse/CB-8345) android: Make "splash" the default resource ID instead of null
202 | * docs: added Windows to supported platforms
203 | * [CB-7964](https://issues.apache.org/jira/browse/CB-7964) Add cordova-plugin-splashscreen support for browser platform
204 | * [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme
205 | * [wp8] oops, Added back config parse result checks
206 | * [WP8] code cleanup, minor refactors, comments to clarify some stuff.
207 | * Extend WP8 Splash Screen to respect SplashScreen and SplashScreenDelay preferences from config file
208 | * [CB-8574](https://issues.apache.org/jira/browse/CB-8574) Integrate TravisCI
209 | * [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen
210 | * [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file
211 | * [CB-8397](https://issues.apache.org/jira/browse/CB-8397) Add support to 'windows' for showing the Windows Phone splashscreen
212 |
213 | ### 1.0.0 (Feb 04, 2015)
214 | * [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Stop using deprecated IsIpad macro
215 | * [CB-3679](https://issues.apache.org/jira/browse/CB-3679) Add engine tag for Android >= 3.6.0 due to use of `preferences`
216 | * [CB-3679](https://issues.apache.org/jira/browse/CB-3679) Make SplashScreen plugin compatible with cordova-android@4.0.x
217 |
218 | ### 0.3.5 (Dec 02, 2014)
219 | * [CB-7204](https://issues.apache.org/jira/browse/CB-7204) - Race condition when hiding and showing spinner (closes #21)
220 | * [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen
221 |
222 | ### 0.3.4 (Oct 03, 2014)
223 | * Finalized iOS splash screen (image name) tests. 176 tests in all, 44 for each type of device (iPad, iPhone, iPhone5, iPhone6, iPhone 6 Plus).
224 | * [CB-7633](https://issues.apache.org/jira/browse/CB-7633) - (Re-fix based on updated unit tests) iPhone 6 Plus support
225 | * Updated iOS tests for locked orientations
226 | * Added more iOS splash screen tests.
227 | * [CB-7633](https://issues.apache.org/jira/browse/CB-7633) - Add support for iPhone 6/6+
228 | * Added failing iPhone 6/6 Plus tests.
229 | * Added 'npm test'
230 | * [CB-7663](https://issues.apache.org/jira/browse/CB-7663) - iOS unit tests for splash screen
231 | * Properly formatted splashscreen preference docs.
232 |
233 | ### 0.3.3 (Sep 17, 2014)
234 | * [CB-7249](https://issues.apache.org/jira/browse/CB-7249) cordova-plugin-splashscreen documentation translation
235 | * Renamed test dir, added nested `plugin.xml`
236 | * added documentation for manual tests
237 | * [CB-7196](https://issues.apache.org/jira/browse/CB-7196) port splashscreen tests to framework
238 |
239 | ### 0.3.2 (Aug 06, 2014)
240 | * [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs
241 | * [CB-7041](https://issues.apache.org/jira/browse/CB-7041) ios: Fix image filename logic when setting the iPad splash screen
242 | * fixes Splashscreen crash on WP8
243 | * Remove outdated doc
244 |
245 | ### 0.3.1 (Jun 05, 2014)
246 | * documentation translation: cordova-plugin-splashscreen
247 | * Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen
248 | * Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen
249 | * Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen
250 | * Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen
251 | * [CB-6810](https://issues.apache.org/jira/browse/CB-6810) Add license to CONTRIBUTING.md
252 | * [wp8] updated quirk for and combined iOS,WP8,BB10 quirks as they are all the same
253 | * [wp] implemented OnInit so splash screen can be shown before cordova page is loaded
254 | * [wp] plugin must be autoloaded for AutoHideSplashScreen preference to work
255 | * [CB-6483](https://issues.apache.org/jira/browse/CB-6483) Use splash screen image from manifest on Windows8
256 | * [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
257 | * Revert "Merge branch 'tizen' of http://github.com/siovene/cordova-plugin-splashscreen"
258 |
259 | ### 0.3.0 (Apr 17, 2014)
260 | * Add Tizen support to plugin
261 | * [CB-6422](https://issues.apache.org/jira/browse/CB-6422): [windows8] use cordova/exec/proxy
262 | * [CB-4051](https://issues.apache.org/jira/browse/CB-4051): [ios] - Re-fix - Splashscreen rotation problem (closes #13)
263 | * [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers
264 | * [CB-6465](https://issues.apache.org/jira/browse/CB-6465): Add license headers to Tizen code
265 | * Add NOTICE file
266 |
267 | ### 0.2.7 (Feb 05, 2014)
268 | * [CB-3562](https://issues.apache.org/jira/browse/CB-3562) Fix aspect ratio on landscape-only iPhone applications
269 | * [CB-4051](https://issues.apache.org/jira/browse/CB-4051) fix for splashscreen rotation problem
270 |
271 | ### 0.2.6 (Jan 02, 2014)
272 | * [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Add doc/index.md for Splashscreen plugin
273 | * Handle error when splash image is missing.
274 |
275 | ### 0.2.5 (Dec 4, 2013)
276 | * add ubuntu platform
277 | * Added amazon-fireos platform. Change to use amazon-fireos as a platform if the user agent string contains 'cordova-amazon-fireos'
278 | * [CB-5124](https://issues.apache.org/jira/browse/CB-5124) - Remove splashscreen config.xml values from iOS Configuration Docs, move to plugin docs
279 |
280 | ### 0.2.4 (Oct 28, 2013)
281 | * [CB-5128](https://issues.apache.org/jira/browse/CB-5128): add repo + issue tag to `plugin.xml` for splashscreen plugin
282 | * [CB-5010](https://issues.apache.org/jira/browse/CB-5010) Incremented plugin version on dev branch.
283 |
284 | ### 0.2.3 (Oct 9, 2013)
285 | * [CB-4806](https://issues.apache.org/jira/browse/CB-4806) Re-fix Update splashscreen image bounds for iOS 7
286 | * [CB-4934](https://issues.apache.org/jira/browse/CB-4934) plugin-splashscreen should not show by default on Windows8
287 | * [CB-4929](https://issues.apache.org/jira/browse/CB-4929) plugin-splashscreen not loading proxy windows8
288 | * [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch.
289 |
290 | ### 0.2.2 (Sept 25, 2013)
291 | * [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version
292 | * [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.splashscreen to org.apache.cordova.splashscreen
293 | * Rename CHANGELOG.md -> RELEASENOTES.md
294 | * [CB-4806](https://issues.apache.org/jira/browse/CB-4806) Update splashscreen image bounds for iOS 7
295 | * [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch.
296 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cordova-plugin-splashscreen",
3 | "version": "7.0.0-dev",
4 | "description": "Cordova Splashscreen Plugin",
5 | "types": "./types/index.d.ts",
6 | "cordova": {
7 | "id": "cordova-plugin-splashscreen",
8 | "platforms": [
9 | "browser"
10 | ]
11 | },
12 | "repository": "github:apache/cordova-plugin-splashscreen",
13 | "bugs": "https://github.com/apache/cordova-plugin-splashscreen/issues",
14 | "keywords": [
15 | "cordova",
16 | "splashscreen",
17 | "ecosystem:cordova",
18 | "cordova-browser"
19 | ],
20 | "scripts": {
21 | "test": "npm run lint",
22 | "lint": "eslint ."
23 | },
24 | "engines": {
25 | "cordovaDependencies": {
26 | "2.0.0": {
27 | "cordova-android": ">=3.6.0"
28 | },
29 | ">=4.0.0": {
30 | "cordova-android": ">=3.6.0",
31 | "cordova-windows": ">=4.4.0"
32 | },
33 | "<6.0.0": {
34 | "cordova-ios": "<6.0.0"
35 | },
36 | "6.0.2": {
37 | "cordova-android": ">=3.6.0 <11.0.0",
38 | "cordova-windows": ">=4.4.0"
39 | },
40 | "<7.0.0": {
41 | "cordova-android": ">=3.6.0 <11.0.0",
42 | "cordova-windows": ">=4.4.0"
43 | },
44 | "8.0.0": {
45 | "cordova": ">100"
46 | }
47 | }
48 | },
49 | "author": "Apache Software Foundation",
50 | "license": "Apache-2.0",
51 | "devDependencies": {
52 | "@cordova/eslint-config": "^3.0.0"
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/plugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
24 | Splashscreen
25 | Cordova Splashscreen Plugin
26 | Apache 2.0
27 | cordova,splashscreen
28 | https://github.com/apache/cordova-plugin-splashscreen.git
29 | https://github.com/apache/cordova-plugin-splashscreen/issues
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/src/browser/SplashScreenProxy.js:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | *
20 | */
21 |
22 | // Default parameter values including image size can be changed in `config.xml`
23 | var splashImageWidth = 170;
24 | var splashImageHeight = 200;
25 | var position = { x: 0, y: 0, width: splashImageWidth, height: splashImageHeight };
26 | var localSplash; // the image to display
27 | var localSplashImage;
28 | var bgColor = '#464646';
29 | var imageSrc = '/img/logo.png';
30 | var splashScreenDelay = 3000; // in milliseconds
31 | var showSplashScreen = true; // show splashcreen by default
32 | var cordova = require('cordova');
33 | var configHelper = cordova.require('cordova/confighelper');
34 | var autoHideSplashScreen = true;
35 |
36 | function updateImageLocation () {
37 | position.width = Math.min(splashImageWidth, window.innerWidth);
38 | position.height = position.width * (splashImageHeight / splashImageWidth);
39 |
40 | localSplash.style.width = window.innerWidth + 'px';
41 | localSplash.style.height = window.innerHeight + 'px';
42 | localSplash.style.top = '0px';
43 | localSplash.style.left = '0px';
44 |
45 | localSplashImage.style.top = '50%';
46 | localSplashImage.style.left = '50%';
47 | localSplashImage.style.height = position.height + 'px';
48 | localSplashImage.style.width = position.width + 'px';
49 | localSplashImage.style.marginTop = (-position.height / 2) + 'px';
50 | localSplashImage.style.marginLeft = (-position.width / 2) + 'px';
51 | }
52 |
53 | function onResize () {
54 | updateImageLocation();
55 | }
56 |
57 | var SplashScreen = {
58 | setBGColor: function (cssBGColor) {
59 | bgColor = cssBGColor;
60 | if (localSplash) {
61 | localSplash.style.backgroundColor = bgColor;
62 | }
63 | },
64 | show: function () {
65 | if (!localSplash) {
66 | window.addEventListener('resize', onResize, false);
67 | localSplash = document.createElement('div');
68 | localSplash.style.backgroundColor = bgColor;
69 | localSplash.style.position = 'absolute';
70 | localSplash.style['z-index'] = '99999';
71 |
72 | localSplashImage = document.createElement('img');
73 | localSplashImage.src = imageSrc;
74 | localSplashImage.style.position = 'absolute';
75 |
76 | updateImageLocation();
77 |
78 | localSplash.appendChild(localSplashImage);
79 | document.body.appendChild(localSplash);
80 |
81 | // deviceready fires earlier than the plugin init on cold-start
82 | if (SplashScreen.shouldHideImmediately) {
83 | SplashScreen.shouldHideImmediately = false;
84 | window.setTimeout(function () {
85 | SplashScreen.hide();
86 | }, 1000);
87 | }
88 | }
89 | },
90 | hide: function () {
91 | if (localSplash) {
92 | var innerLocalSplash = localSplash;
93 | localSplash = null;
94 | window.removeEventListener('resize', onResize, false);
95 |
96 | innerLocalSplash.style.opacity = '0';
97 | innerLocalSplash.style['-webkit-transition'] = 'opacity 1s ease-in-out';
98 | innerLocalSplash.style['-moz-transition'] = 'opacity 1s ease-in-out';
99 | innerLocalSplash.style['-ms-transition'] = 'opacity 1s ease-in-out';
100 | innerLocalSplash.style['-o-transition'] = 'opacity 1s ease-in-out';
101 |
102 | window.setTimeout(function () {
103 | document.body.removeChild(innerLocalSplash);
104 | innerLocalSplash = null;
105 | }, 1000);
106 | } else {
107 | SplashScreen.shouldHideImmediately = true;
108 | }
109 | }
110 | };
111 |
112 | /**
113 | * Reads preferences via ConfigHelper and substitutes default parameters.
114 | */
115 | function readPreferencesFromCfg (cfg) {
116 | try {
117 | var value = cfg.getPreferenceValue('ShowSplashScreen');
118 | if (typeof value !== 'undefined') {
119 | showSplashScreen = value === 'true';
120 | }
121 |
122 | splashScreenDelay = cfg.getPreferenceValue('SplashScreenDelay') || splashScreenDelay;
123 | splashScreenDelay = parseInt(splashScreenDelay, 10);
124 |
125 | imageSrc = cfg.getPreferenceValue('SplashScreen') || imageSrc;
126 | bgColor = cfg.getPreferenceValue('SplashScreenBackgroundColor') || bgColor;
127 | splashImageWidth = cfg.getPreferenceValue('SplashScreenWidth') || splashImageWidth;
128 | splashImageHeight = cfg.getPreferenceValue('SplashScreenHeight') || splashImageHeight;
129 | autoHideSplashScreen = cfg.getPreferenceValue('AutoHideSplashScreen') || autoHideSplashScreen;
130 | autoHideSplashScreen = (autoHideSplashScreen === true || autoHideSplashScreen.toLowerCase() === 'true');
131 | } catch (e) {
132 | var msg = '[Browser][SplashScreen] Error occurred on loading preferences from config.xml: ' + JSON.stringify(e);
133 | console.error(msg);
134 | }
135 | }
136 |
137 | /**
138 | * Shows and hides splashscreen if it is enabled, with a delay according the current preferences.
139 | */
140 | function showAndHide () {
141 | if (showSplashScreen) {
142 | SplashScreen.show();
143 |
144 | window.setTimeout(function () {
145 | SplashScreen.hide();
146 | }, splashScreenDelay);
147 | }
148 | }
149 |
150 | /**
151 | * Tries to read config.xml and override default properties and then shows and hides splashscreen if it is enabled.
152 | */
153 | (function initAndShow () {
154 | configHelper.readConfig(function (config) {
155 | readPreferencesFromCfg(config);
156 | if (autoHideSplashScreen) {
157 | showAndHide();
158 | } else {
159 | SplashScreen.show();
160 | }
161 | }, function (err) {
162 | console.error(err);
163 | });
164 | })();
165 |
166 | module.exports = SplashScreen;
167 |
168 | require('cordova/exec/proxy').add('SplashScreen', SplashScreen);
169 |
--------------------------------------------------------------------------------
/tests/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cordova-plugin-splashscreen-tests",
3 | "version": "7.0.0-dev",
4 | "description": "",
5 | "cordova": {
6 | "id": "cordova-plugin-splashscreen-tests",
7 | "platforms": []
8 | },
9 | "keywords": [
10 | "ecosystem:cordova"
11 | ],
12 | "author": "",
13 | "license": "Apache 2.0"
14 | }
15 |
--------------------------------------------------------------------------------
/tests/plugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
24 | Cordova Splashscreen Plugin Tests
25 | Apache 2.0
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/tests/tests.js:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | *
20 | */
21 |
22 | exports.defineAutoTests = function () {
23 | describe('Splashscreen (cordova)', function () {
24 | it('splashscreen.spec.1 should exist', function () {
25 | expect(navigator.splashscreen).toBeDefined();
26 | });
27 |
28 | it('splashscreen.spec.2 show method should exist', function () {
29 | expect(navigator.splashscreen.show).toBeDefined();
30 | expect(typeof navigator.splashscreen.show).toBe('function');
31 | });
32 |
33 | it('splashscreen.spec.3 hide method should exist', function () {
34 | expect(navigator.splashscreen.hide).toBeDefined();
35 | expect(typeof navigator.splashscreen.hide).toBe('function');
36 | });
37 | });
38 | };
39 |
40 | exports.defineManualTests = function (contentEl, createActionButton) {
41 | function showFor (duration) {
42 | navigator.splashscreen.show();
43 | window.setTimeout(function () {
44 | navigator.splashscreen.hide();
45 | }, 1000 * duration);
46 | }
47 |
48 | contentEl.innerHTML = '
Splashscreen Tests
' +
49 | '' +
50 | 'Expected result: Will show the Cordova splashscreen for 1 second' +
51 | ' ' +
52 | 'Expected result: Will show the Cordova splashscreen for 5 seconds';
53 |
54 | createActionButton('Show for 1 second', function () {
55 | showFor(1);
56 | }, 'show1');
57 |
58 | createActionButton('Show for 5 seconds', function () {
59 | showFor(5);
60 | }, 'show5');
61 | };
62 |
--------------------------------------------------------------------------------
/types/index.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for Apache Cordova Splashscreen plugin
2 | // Project: https://github.com/apache/cordova-plugin-splashscreen
3 | // Definitions by: Microsoft Open Technologies Inc
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 | //
6 | // Copyright (c) Microsoft Open Technologies Inc
7 | // Licensed under the MIT license.
8 |
9 | interface Navigator {
10 | /** This plugin displays and hides a splash screen during application launch. */
11 | splashscreen: {
12 | /** Dismiss the splash screen. */
13 | hide(): void;
14 | /** Displays the splash screen. */
15 | show(): void;
16 | }
17 | }
--------------------------------------------------------------------------------
/www/splashscreen.js:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | *
20 | */
21 |
22 | var exec = require('cordova/exec');
23 |
24 | var splashscreen = {
25 | show: function () {
26 | exec(null, null, 'SplashScreen', 'show', []);
27 | },
28 | hide: function () {
29 | exec(null, null, 'SplashScreen', 'hide', []);
30 | }
31 | };
32 |
33 | module.exports = splashscreen;
34 |
--------------------------------------------------------------------------------