Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Fix broken UI after restoring a Youtube session (#2181)
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro authored and bluemarvin committed Nov 6, 2019
1 parent a812dce commit 700cadc
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ private void restore() {
} else if(mState.mSessionState == null || mState.mUri.equals(mContext.getResources().getString(R.string.about_blank)) ||
(mState.mSessionState != null && mState.mSessionState.size() == 0)) {
loadHomePage();
} else if (mState.mUri != null && mState.mUri.contains(".youtube.com")) {
mState.mSession.loadUri(mState.mUri);
}

dumpAllState();
Expand Down Expand Up @@ -391,6 +393,9 @@ private GeckoSession createGeckoSession(@NonNull SessionSettings aSettings) {
.useMultiprocess(aSettings.isMultiprocessEnabled())
.usePrivateMode(mUsePrivateMode)
.useTrackingProtection(aSettings.isTrackingProtectionEnabled())
.userAgentMode(aSettings.getUserAgentMode())
.viewportMode(aSettings.getViewportMode())
.suspendMediaWhenInactive(aSettings.isSuspendMediaWhenInactiveEnabled())
.build();

GeckoSession session;
Expand All @@ -400,8 +405,6 @@ private GeckoSession createGeckoSession(@NonNull SessionSettings aSettings) {
session = new GeckoSession(geckoSettings);
}

session.getSettings().setSuspendMediaWhenInactive(aSettings.isSuspendMediaWhenInactiveEnabled());
session.getSettings().setUserAgentMode(aSettings.getUserAgentMode());
session.getSettings().setUserAgentOverride(aSettings.getUserAgentOverride());

return session;
Expand Down

0 comments on commit 700cadc

Please sign in to comment.