forked from tootyta/FlashBrowser2
-
-
Notifications
You must be signed in to change notification settings - Fork 61
/
settings.html
84 lines (79 loc) · 3.72 KB
/
settings.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="themes/chrome-like.css">
</head>
<!-- <div id="flash-tabs" style="display: inline;">
<embed id="FlashTab1" src="https://flash.pm/games/F.php?swf=files/adventure,%20escape,%20fighter/Achilles.swf" style='display: none;' width="320" height="200"></embed>
<embed id="FlashTab2" src="https://flash.pm/games/F.php?swf=files/adventure,%20escape,%20fighter/Alias-3.swf" style='display: none;' width="320" height="200"></embed>
<embed id="FlashTab3" src="https://flash.pm/games/F.php?swf=files/typing/Qwerty-Warriors-2.swf" width="320" style='display: none;' width="320" height="200"></embed>
</div>
-->
<body>
<div id="window-controls">
<div class="button" id="min-button">
<img class="icon" srcset="icons/min-w-10.png 1x, icons/min-w-12.png 1.25x, icons/min-w-15.png 1.5x, icons/min-w-15.png 1.75x, icons/min-w-20.png 2x, icons/min-w-20.png 2.25x, icons/min-w-24.png 2.5x, icons/min-w-30.png 3x, icons/min-w-30.png 3.5x" draggable="false" />
</div>
<div class="button" id="max-button">
<img class="icon" srcset="icons/max-w-10.png 1x, icons/max-w-12.png 1.25x, icons/max-w-15.png 1.5x, icons/max-w-15.png 1.75x, icons/max-w-20.png 2x, icons/max-w-20.png 2.25x, icons/max-w-24.png 2.5x, icons/max-w-30.png 3x, icons/max-w-30.png 3.5x" draggable="false" />
</div>
<div class="button" id="restore-button">
<img class="icon" srcset="icons/restore-w-10.png 1x, icons/restore-w-12.png 1.25x, icons/restore-w-15.png 1.5x, icons/restore-w-15.png 1.75x, icons/restore-w-20.png 2x, icons/restore-w-20.png 2.25x, icons/restore-w-24.png 2.5x, icons/restore-w-30.png 3x, icons/restore-w-30.png 3.5x" draggable="false" />
</div>
<div class="button" id="close-button">
<img class="icon" srcset="icons/close-w-10.png 1x, icons/close-w-12.png 1.25x, icons/close-w-15.png 1.5x, icons/close-w-15.png 1.75x, icons/close-w-20.png 2x, icons/close-w-20.png 2.25x, icons/close-w-24.png 2.5x, icons/close-w-30.png 3x, icons/close-w-30.png 3.5x" draggable="false" />
</div>
</div>
<div id="nav-body-tabs"></div>
<div id="nav-body-ctrls"></div>
<div id="nav-body-views"></div>
<script>
const Store = require('./store');
const store = new Store({
configName: 'user-preferences'
});
let home
try{
home = store.get('homepage');
}
catch (error) {
home = null;
}
const enav = new (require('electron-navigation'))({
defaultFavicons: true,
newTabCallback: (url, options) => {
options.postTabOpenCallback = webview => {
webview.setAttribute('plugins', '');
}
return {options};
}
});
const {clipboard} = require('electron');
//clipboard.writeText('Example String');
let clipboardStr = clipboard.readText();
var length = window.process.argv.length;
var lastArgument = window.process.argv[length-1]
if(lastArgument && lastArgument.indexOf("file:///") == 0) {
console.log(lastArgument);
//lastArgument = 'file:///D:/FlashPM/FlashBrowser-master/AS3.html';
//lastArgument = 'file:///D:/FlashPM/FlashBrowser-master/noimage.swf';
//var path2 = lastArgument.replace(/\\/g, "/");
//path2 = 'file:///' + path2;
// open a local file, and use a custom icon
enav.newTab(lastArgument, {
title: 'Local file'
})
}
else if(clipboardStr.indexOf("https://") == 0) {
enav.newTab(clipboardStr);
mainWindow.show();
}
else if(home){
console.log("WE HAGE CUSTOM HOMEPAGE" + home);
enav.newTab(home, {icon: "icons/restore-w-24.png"})}
else{
enav.newTab('https://search.flash.pm/', {icon: "clear"});
}
</script>
</body>
</html>