Merge pull request #41 from avatao-content/urlbar

Fix urlbar.
This commit is contained in:
therealkrispet 2019-08-05 11:07:24 +02:00 committed by GitHub
commit ec289081c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -160,12 +160,21 @@ export class DashboardComponent implements OnInit, OnDestroy {
iframeLoad(): void {
if (this.webiframe) {
this.actualIframeUrl = this.webiframe.nativeElement.contentWindow.frames.location.pathname;
const href = this.webiframe.nativeElement.contentWindow.frames.location.href;
const niceURL = href.match(/.*?\/\/.*?(\/.*)/)[1];
this.actualIframeUrl = niceURL;
}
}
changeIframeURL() {
this.webiframe.nativeElement.contentWindow.frames.location.pathname = this.urlbar.nativeElement.value;
const userGivenValue = this.urlbar.nativeElement.value.trim();
if(
userGivenValue == '/' ||
userGivenValue.startsWith('dashboard') ||
userGivenValue.startsWith('/dashboard')
)
return;
this.webiframe.nativeElement.contentWindow.frames.location.href = this.urlbar.nativeElement.value;
}
pollingServerForIframeReload() {