diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java
index 712bdcb81..d8ca3003d 100644
--- a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java
+++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java
@@ -386,16 +386,15 @@ private void restore() {
loadDefaultPage();
} else if (mState.mSessionState != null) {
mState.mSession.restoreState(mState.mSessionState);
+ if (mState.mUri != null && mState.mUri.contains(".youtube.com")) {
+ mState.mSession.loadUri(mState.mUri, GeckoSession.LOAD_FLAGS_REPLACE_HISTORY);
+ }
} else if (mState.mUri != null) {
mState.mSession.loadUri(mState.mUri);
} else {
loadDefaultPage();
}
- if (mState.mUri != null && mState.mUri.contains(".youtube.com")) {
- mState.mSession.loadUri(mState.mUri, GeckoSession.LOAD_FLAGS_REPLACE_HISTORY);
- }
-
dumpAllState();
mState.setActive(true);
}
diff --git a/app/src/main/assets/userAgentOverride.json b/app/src/main/assets/userAgentOverride.json
index e41ccbbc0..79ede3a9e 100644
--- a/app/src/main/assets/userAgentOverride.json
+++ b/app/src/main/assets/userAgentOverride.json
@@ -1,3 +1,6 @@
{
"744723238cc3c00582d7ff9e8ece83e6503a3926d8c07491672d5da3634be41e1d41580dd3694b663c0d0a5e64280a2b411a1346e6ed0d53d694835781cf6436": "Mozilla/5.0 (X11; Linux x86_64; rv:69) Gecko/20100101 Firefox/69.0",
+ "ae0755740e4354ac67025056e775ad06d8a529ae4f37244fbb02d72199e2c780311e47aa9895079b980ec4bfa676f1f39c4ab41ea995c524e52bde9a73623da2": "Mozilla/5.0 (Linux; Android 7.1.1; Quest) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/7.0.13.186866463 SamsungBrowser/4.0 Chrome/77.0.3865.126 Mobile VR Safari/537.36",
+ "e6137b4c2f49a3917c2c90a50fb270a5eebb962f2c72344ae2e29e321bb21891e5ca4fec06cae78e14f4a8510473e934234e9ec3f60e8415f5f6da754c55b9b1": "Mozilla/5.0 (Linux; Android 7.1.1; Quest) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/7.0.13.186866463 SamsungBrowser/4.0 Chrome/77.0.3865.126 Mobile VR Safari/537.36"
}
+
\ No newline at end of file
diff --git a/app/src/main/assets/web_extensions/webcompat_youtube/main.js b/app/src/main/assets/web_extensions/webcompat_youtube/main.js
index 151a7b7de..812e77894 100644
--- a/app/src/main/assets/web_extensions/webcompat_youtube/main.js
+++ b/app/src/main/assets/web_extensions/webcompat_youtube/main.js
@@ -31,9 +31,10 @@ class YoutubeExtension {
if (viewport) {
viewport.setAttribute('content', content);
} else {
- document.head.insertAdjacentHTML('afterbegin', ``);
+ const container = document.head || document.documentElement;
+ container.insertAdjacentHTML('afterbegin', ``);
}
- logDebug(`Youtube viewport updated`);
+ logDebug(`Youtube viewport updated: ${window.innerWidth}x${window.innerHeight} `);
}
// Select a better youtube video quality
@@ -203,7 +204,7 @@ class YoutubeExtension {
logDebug(`Initializing youtube extension in frame: ${window.location.href}`);
const youtube = new YoutubeExtension();
youtube.overrideUA();
-window.addEventListener('DOMContentLoaded', () => youtube.overrideViewport());
+youtube.overrideViewport();
window.addEventListener('load', () => {
logDebug('page load');
youtube.overrideVideoProjection();