forked from Dani3lSun/apex-app-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
48 lines (45 loc) · 1.33 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<title>APEX Plugins</title>
</head>
<body style="overflow: hidden">
<style>
html,
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
</style>
<!-- Webview
Parameter:
autosize="on",
allowpopups (allow new windows created inside webview),
minwidth,
minheight,
useragent (UserAgent inside the webview - used for authorization scheme in APEX)
-->
<webview id="apex-plugin-app" src="https://apex.oracle.com/pls/apex/f?p=APEXPLUGIN" autosize="on" allowpopups minwidth="1024" minheight="800" useragent="APEXDESKTOP"></webview>
<!-- Webview JS -->
<script>
var webview = document.getElementById("apex-plugin-app");
var apexutils = require('./apexutils');
// open href links in electron app
webview.addEventListener('new-window', function(e) {
window.open(e.url, e.frameName, "resizable,scrollbars,status");
});
// console message events (functions wrapped into console messages)
webview.addEventListener('console-message', function(e) {
var stringDevider = "::";
var position = e.message.indexOf(stringDevider);
var messageType = e.message.substr(0, position);
// open local file
if (messageType === 'open-file') {
apexutils.openLocalFile(e.message);
}
});
</script>
</body>
</html>