Neutralino & new project structure
This commit is contained in:
22
platforms/browser.js
Normal file
22
platforms/browser.js
Normal file
@@ -0,0 +1,22 @@
|
||||
function Platform() {
|
||||
this.save = async (path, data) => {
|
||||
localStorage.setItem(path, data)
|
||||
}
|
||||
|
||||
this.open = (path) => {
|
||||
return localStorage.getItem(path)
|
||||
}
|
||||
|
||||
this.readdir = (path) => {
|
||||
return Object.keys(localStorage)
|
||||
.filter(key => key.startsWith(path))
|
||||
}
|
||||
|
||||
this.createWindow = url => {
|
||||
return window.open(url ?? 'about:blank', '_blank')
|
||||
}
|
||||
|
||||
this.createInstance = url => {
|
||||
return window.open(url ?? this.location)
|
||||
}
|
||||
}
|
||||
3
platforms/neutralino.js
Normal file
3
platforms/neutralino.js
Normal file
@@ -0,0 +1,3 @@
|
||||
function Platform() {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user