@overwolf/ow-electron 12.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +121 -0
- package/checksums.json +8 -0
- package/cli.js +25 -0
- package/electron.d.ts +16176 -0
- package/index.js +21 -0
- package/install.js +107 -0
- package/package.json +29 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) Electron contributors
|
|
2
|
+
Copyright (c) 2013-2020 GitHub Inc.
|
|
3
|
+
Copyright (c) Overwolf Ltd.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Overwolf Electron
|
|
2
|
+
|
|
3
|
+
We currently have these npm packages:
|
|
4
|
+
|
|
5
|
+
- [@overwolf/ow-electron](https://www.npmjs.com/package/@overwolf/ow-electron) is a package based on the
|
|
6
|
+
[electron package](https://www.npmjs.com/package/electron), which adds a
|
|
7
|
+
few features to it
|
|
8
|
+
- [@overwolf/ow-electron-builder](https://www.npmjs.com/package/@overwolf/ow-electron-builder) is a packaged based on electron-builder which
|
|
9
|
+
supports building ow-electron
|
|
10
|
+
- @overwolf/electron-is-overwolf - similar to
|
|
11
|
+
[electron-is-dev](https://www.npmjs.com/package/electron-is-dev)
|
|
12
|
+
|
|
13
|
+
There is no problem that both packages reside side-by-side with the original
|
|
14
|
+
electron/electron-builder packages in your project. You just have to create new
|
|
15
|
+
package.json scripts:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
"scripts": {
|
|
19
|
+
...
|
|
20
|
+
|
|
21
|
+
"start": "ow-electron .",
|
|
22
|
+
"build:ow-electron": "ow-electron-builder --publish=never"
|
|
23
|
+
},
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## package.json properties
|
|
27
|
+
|
|
28
|
+
Each ow-electron app should have a unique id. The unique id is auto-generated
|
|
29
|
+
based on the <productName/name + author.name> fields of the package.json.
|
|
30
|
+
|
|
31
|
+
We use this for ad optimization and optionally, for
|
|
32
|
+
[anonymous analytics](#anonymous-analytics) reports that you may review on our developer's console.
|
|
33
|
+
|
|
34
|
+
> **NOTE:** To see the generated uid - you can use the OVERWOLF_APP_UID
|
|
35
|
+
> environment variable (process.env.OVERWOLF_APP_UID) once the |app.whenReady|
|
|
36
|
+
> triggers. Before the app is ready, the variable won't exist.
|
|
37
|
+
|
|
38
|
+
## owadview tag
|
|
39
|
+
|
|
40
|
+
> **NOTE:** In order to see ads, we first have to setup our backend to support
|
|
41
|
+
> your app's uid (See package.json properties above).
|
|
42
|
+
> Please contact us for further info on this
|
|
43
|
+
> [contact us](https://overwolf.github.io/support/contact-us)
|
|
44
|
+
|
|
45
|
+
The <owadview/> tag, which is based on the Electron <webview/> tag, hosts and
|
|
46
|
+
auto manages ads in your app.
|
|
47
|
+
|
|
48
|
+
To use it, place the <owadview/> tag (no attributes required) inside a <div> tag
|
|
49
|
+
which has the size of the standard IAB ad unit you wish to display.
|
|
50
|
+
|
|
51
|
+
See https://overwolf.github.io/start/monetize-with-ads/ads-monetization-basics
|
|
52
|
+
for some more information about supported ad units + Dos’ and ‘Dont’s. This
|
|
53
|
+
documentation is aimed at the Overwolf platform, however, the general ad
|
|
54
|
+
details are relevant for the ow-electron build as well.
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
<div style="width: 400px;height: 300px; background: transparent;">
|
|
58
|
+
<owadview />
|
|
59
|
+
</div>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
> **NOTE:** We use background: transparent so that you can show a background
|
|
63
|
+
> image as a fallback when there are no ads inventory to display.
|
|
64
|
+
|
|
65
|
+
A few extra things to know:
|
|
66
|
+
|
|
67
|
+
- The <owadview/> starts auto-muted. This can be changed, see
|
|
68
|
+
https://www.electronjs.org/docs/latest/api/webview-tag#webviewsetaudiomutedmuted
|
|
69
|
+
- The tag is self managed so there is no need to worry about visiblity of ads
|
|
70
|
+
or crashes
|
|
71
|
+
|
|
72
|
+
## Anonymous Analytics
|
|
73
|
+
|
|
74
|
+
In order to generate some reports for you about the usage of your ow-electron
|
|
75
|
+
app, we collect very few anonymous analytics (such as when the app is launched
|
|
76
|
+
and when an app's window is shown).
|
|
77
|
+
|
|
78
|
+
You can disable this via code:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
import { app } from 'electron';
|
|
82
|
+
|
|
83
|
+
app.overwolf.disableAnonymousAnalytics();
|
|
84
|
+
|
|
85
|
+
...
|
|
86
|
+
|
|
87
|
+
app.whenReady().then(...
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
> **NOTE:** This call isn't persistent across sessions - it needs to be called
|
|
91
|
+
> every time the app is launched.
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## Consent Management Platform (CMP)
|
|
95
|
+
|
|
96
|
+
CMP makes it easier for you to meet the technical requirements of the law by simplifying the legally required process of collecting consent to cookies.
|
|
97
|
+
|
|
98
|
+
Before using your app, the user should be informed about the existence of the CMP and be able to easily access it.
|
|
99
|
+
|
|
100
|
+
We recommend showing this information during the installation phase or as a first-time usage message.
|
|
101
|
+
|
|
102
|
+
The ow-electron comes with a CMP implementation built in.
|
|
103
|
+
|
|
104
|
+
> **NOTE:** You can leverage our Windows Installer for this (contact us).
|
|
105
|
+
|
|
106
|
+
In order to know if the user is required to be informed about the CMP - use the |app.overwolf.isCMPRequired| api:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
import { app } from 'electron';
|
|
110
|
+
|
|
111
|
+
await app.overwolf.isCMPRequired();
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
In order to open the built-in CMP window - use the |app.overwolf.openCMPWindow| api:
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
app.overwolf.openCMPWindow();
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
|
package/checksums.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"electron-api.json": "5cdff2c72e8ed445662aea8ac8a9775b1c5675e9337f1683e865d599577912fc",
|
|
3
|
+
"ow-electron-v12.2.3-darwin-arm64.zip": "d29d234c09ba810d89ed1fba9e405b6975916ea208d001348379f89b50d1835c",
|
|
4
|
+
"ow-electron-v12.2.3-darwin-x64.zip": "5af34f1198ce9fd17e9fa581f57a8ad2c9333187fb617fe943f30b8cde9e6231",
|
|
5
|
+
"ow-electron-v12.2.3-linux-x64.zip": "deae6d0941762147716b8298476080d961df2a32d0f6f57b244cbe3a2553cd24",
|
|
6
|
+
"ow-electron-v12.2.3-win32-x64.zip": "944b25fcce24b825d79041949411a4a1e600cace642b1c554e3eeb0b3ba38ece",
|
|
7
|
+
"electron.d.ts": "41eb5e1e0a72ac70cf30fc377e7b821fd62d24104e7ee6621a02f0c55b561cf4"
|
|
8
|
+
}
|
package/cli.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const electron = require('./');
|
|
4
|
+
|
|
5
|
+
const proc = require('child_process');
|
|
6
|
+
|
|
7
|
+
const child = proc.spawn(electron, process.argv.slice(2), { stdio: 'inherit', windowsHide: false });
|
|
8
|
+
child.on('close', function (code, signal) {
|
|
9
|
+
if (code === null) {
|
|
10
|
+
console.error(electron, 'exited with signal', signal);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
process.exit(code);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const handleTerminationSignal = function (signal) {
|
|
17
|
+
process.on(signal, function signalHandler () {
|
|
18
|
+
if (!child.killed) {
|
|
19
|
+
child.kill(signal);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
handleTerminationSignal('SIGINT');
|
|
25
|
+
handleTerminationSignal('SIGTERM');
|