Add initial support for stateUrls

This commit is contained in:
cyber-dream 2023-05-11 02:56:40 +03:00
parent 08473aab11
commit 5b03a465fc
2 changed files with 7 additions and 1 deletions

View File

@ -140,7 +140,7 @@ class FinderWindow{
windowElem = undefined windowElem = undefined
async Init(args){ async Init(args){
console.log(args) // console.log(args)
if (args[1] === "-desktop"){ if (args[1] === "-desktop"){
const params = new URLSearchParams({ const params = new URLSearchParams({
isMobile: WebDesktopEnvironment.isMobile, isMobile: WebDesktopEnvironment.isMobile,

View File

@ -194,6 +194,7 @@ class WebDesktopEnvironment{
*/ */
static CreateNewWindow(appId, width, height) { static CreateNewWindow(appId, width, height) {
let newWindow = document.createElement("div") let newWindow = document.createElement("div")
newWindow.setAttribute('appid', appId)
if (WebDesktopEnvironment.isMobile){ if (WebDesktopEnvironment.isMobile){
newWindow.setAttribute("class", "MobileApplicationWindow") newWindow.setAttribute("class", "MobileApplicationWindow")
document.body.querySelector('#windows-layer').appendChild(newWindow) document.body.querySelector('#windows-layer').appendChild(newWindow)
@ -341,9 +342,14 @@ class WindowsCompositor{
previousWindow.classList.remove("Focused") previousWindow.classList.remove("Focused")
window.classList.add("Focused") window.classList.add("Focused")
} }
// WindowsCompositor.ChangeURL(window)
} }
static ChangeURL(appWindow){
let appId = appWindow.getAttribute('appid')
window.history.replaceState(null, "", `/${appId}/`);
}
} }