Skip to content

Commit 54f1000

Browse files
committed
a commit
1 parent 6409369 commit 54f1000

File tree

8 files changed

+30
-18
lines changed

8 files changed

+30
-18
lines changed

PackageCreator.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@ class PackageCreator
1717
try {app.conf = JSON.parse(fs.readFileSync(PackageCreator.CONF_FILE_PATH));}
1818
catch(e) {console.log('Main: could not load config file:', e); app.exit(0); } // new pc(); return ;}
1919
// load data file, if present
20-
console.log('arcodio', findAppArg('reload-configs'));
2120

2221
if (fs.existsSync(PackageCreator.DATA_FILE_PATH))
2322
{
2423
try
2524
{
2625
app.data = JSON.parse(fs.readFileSync(PackageCreator.DATA_FILE_PATH));
27-
console.log(app.data.is_configured, findAppArg('reload-configs'));
2826
if (app.data.is_configured == true && !findAppArg('reload-configs'))
27+
{
28+
console.log("### APP ALREADY CONFIGURED ###");
2929
return;
30+
}
3031
}
3132
catch(e) {console.log('Main: could not load data file. Reconfiguring Webpage Accessor', e); }
3233
}

config.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"name": "Leonardo Pollini",
77
"email": "[email protected]"
88
},
9-
"version": "0.0.11",
9+
"version": "0.0.20",
1010
"autoupdate": false,
1111
"electron_package": "package.json",
1212
"app_name": "Webpage Accessor",
@@ -58,6 +58,7 @@
5858
},
5959
"other_actions":
6060
{
61+
"enabled": true,
6162
"actions":
6263
{
6364
"toolbar":
@@ -105,7 +106,7 @@
105106
{
106107
"enabled": true,
107108
"extension": "splashscreen",
108-
"splash_timeout": 20,
109+
"splash_timeout": 5,
109110
"splash_url":
110111
{
111112
"pathname": "google.com",

extensions/autoupdate/preload.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ class Autoupdate_preload extends require('../../lib/BasePreload.js')
1010
if (this.__conf.update_mode.mode == "long_press")
1111
{
1212
this.update_click_timeout = this.__conf.update_mode
13+
14+
// bad check: frequent false positives.
1315
window.addEventListener('pointerdown', (event) => {
1416
this.update_check_timer = setTimeout(() => {this.updateCheckRequest()}, this.__conf.update_mode.duration * 1000);
1517
})

extensions/splashscreen/main.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const url = require('url');
88
class Splashscreen extends require('../../lib/BaseModule')
99
{
1010
MODULE_NAME = "splashscreen"; // MUST be the same as the 'extension' field in config.json
11-
required_modules = ['window-events'];
11+
// required_modules = ['window-events'];
1212

1313
is_splashscreen = false;
1414
inputed = true;
@@ -32,13 +32,14 @@ class Splashscreen extends require('../../lib/BaseModule')
3232
this.removeSplash();
3333
});
3434

35+
// Actual splash screen activation time is between 3/4 of the timeout value and 3/2 of the timeout value
3536
setInterval(() => {
3637
if (Env.VERBOSE)
3738
this.log("splash_check");
3839
if (!this.inputed)
3940
this.setSplash();
4041
this.inputed = false;
41-
}, (this.__conf.splash_timeout || 60) * 500);
42+
}, (this.__conf.splash_timeout || 60) * 750);
4243

4344
// const mainTab = TabsManager.activeTabName;
4445
// TabsManager.setNewTab(this.splash, "splash");

extensions/window-events/main.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const { app, globalShortcut } = require('electron');
2-
const {checkActiveModules} = require('../../main')
2+
const {checkActiveModules} = require('../../main');
3+
const Env = require('../../env');
34

45
// Sample Module. Plase copy-paste this file into new module's main folder
56
class WindowSetup extends require('../../lib/BaseModule')
@@ -15,15 +16,18 @@ class WindowSetup extends require('../../lib/BaseModule')
1516
this.window.on('resize', () => {
1617
if (this.window.isFullScreen()) return ;
1718
this.tab.setBounds({x: 0, y: 0 , height: this.window.getContentBounds().height, width: this.window.getContentBounds().width});
18-
this.logWindowDimensions('resize');
19+
if (Env.VERBOSE)
20+
this.logWindowDimensions('resize');
1921
});
2022
this.window.on('enter-full-screen', () => {
2123
this.tab.setBounds({x: 0, y: 0 , height: this.window.getContentBounds().height, width: this.window.getContentBounds().width});
22-
this.logWindowDimensions('enter fullscreen');
24+
if (Env.VERBOSE)
25+
this.logWindowDimensions('enter fullscreen');
2326
});
2427
this.window.on('leave-full-screen', () => {
2528
this.tab.setBounds({x: 0, y: 0 , height: this.window.getContentBounds().height, width: this.window.getContentBounds().width});
26-
this.logWindowDimensions('leave fullscreen');
29+
if (Env.VERBOSE)
30+
this.logWindowDimensions('leave fullscreen');
2731
});
2832

2933
if (this.__conf.enable_shortcuts == true)

lib/BaseModule.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ class BaseModule
6565
catch (e) { this.warn('Could not load conf file for', this.module_name, ':', e, '.'); }
6666

6767
if (!this.__conf) this.warn('__conf not defined.');
68-
else if (this.__conf.enabled == false) return;
69-
68+
else if (this.__conf.enabled == false)
69+
{
70+
this.warn('Module disabled in config.'); return;
71+
}
72+
7073
this.__data = data; // This is the contents of data.json
7174

7275
// this.log('Setting up', this.module_name, 'config:', this.__conf, '...');

main.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ function checkActiveModules()
8181
});
8282
}
8383

84-
// app.on('browser-window-created', (event, window) => {
85-
// console.log('New window created:', window.id);
86-
// window.close();
87-
// // You can check window count here
88-
// });
84+
app.on('browser-window-created', (event, window) => {
85+
console.log('New window created:', window.id);
86+
window.close();
87+
// You can check window count here
88+
});
8989

9090

9191
app.on('ready', createMainWindow);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webpage_accessor",
3-
"version": "0.0.19",
3+
"version": "0.0.20",
44
"description": "Electron tests for independant desktop web app",
55
"author": {
66
"name": "Leonardo Pollini",

0 commit comments

Comments
 (0)