Bug 1290882 - Remove 'Press back to exit' snackbar when entering fullscreen mode. r=ahunt
We decided to remove it because:
* Modern video controls include an exit fullscreen button
* After
bug 1031519, you have to swipe down from the top of the screen to
display the soft back button so the copy does not make sense.
Note that the `MozShowFullScreenWarning` event was removed previously in the
platform in [1] so we remove the listener attachment here without replacing it.
[1]: https://hg.mozilla.org/integration/fx-team/rev/a6a5f79e630d
MozReview-Commit-ID: HwyyUkWkUUH
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -384,20 +384,16 @@ var BrowserApp = {
Services.obs.addObserver(this, "gather-telemetry", false);
Services.obs.addObserver(this, "keyword-search", false);
Services.obs.addObserver(this, "sessionstore-state-purge-complete", false);
Services.obs.addObserver(this, "Fonts:Reload", false);
Services.obs.addObserver(this, "Vibration:Request", false);
Messaging.addListener(this.getHistory.bind(this), "Session:GetHistory");
- function showFullScreenWarning() {
- Snackbars.show(Strings.browser.GetStringFromName("alertFullScreenToast"), Snackbars.LENGTH_LONG);
- }
-
window.addEventListener("fullscreen", function() {
Messaging.sendRequest({
type: window.fullScreen ? "ToggleChrome:Hide" : "ToggleChrome:Show"
});
}, false);
window.addEventListener("fullscreenchange", (e) => {
// This event gets fired on the document and its entire ancestor chain
@@ -406,30 +402,24 @@ var BrowserApp = {
// (per spec). This means the last event on enabling will be for the innermost
// document, which will have fullscreenElement set correctly.
let doc = e.target;
Messaging.sendRequest({
type: doc.fullscreenElement ? "DOMFullScreen:Start" : "DOMFullScreen:Stop",
rootElement: doc.fullscreenElement == doc.documentElement
});
- if (doc.fullscreenElement) {
- showFullScreenWarning();
- } else if (this.fullscreenTransitionTab) {
+ if (this.fullscreenTransitionTab) {
// Tab selection has changed during a fullscreen transition, handle it now.
let tab = this.fullscreenTransitionTab;
this.fullscreenTransitionTab = null;
this._handleTabSelected(tab);
}
}, false);
- // When a restricted key is pressed in DOM full-screen mode, we should display
- // the "Press ESC to exit" warning message.
- window.addEventListener("MozShowFullScreenWarning", showFullScreenWarning, true);
-
NativeWindow.init();
FormAssistant.init();
IndexedDB.init();
XPInstallObserver.init();
CharacterEncoding.init();
ActivityObserver.init();
RemoteDebugger.init();
UserAgentOverrides.init();
--- a/mobile/android/locales/en-US/chrome/browser.properties
+++ b/mobile/android/locales/en-US/chrome/browser.properties
@@ -27,18 +27,16 @@ alertDownloadsResume=Resume
alertDownloadsCancel=Cancel
# LOCALIZATION NOTE (alertDownloadSucceeded): This text is shown as a snackbar inside the app after a
# successful download. %S will be replaced by the file name of the download.
alertDownloadSucceeded=%S downloaded
# LOCALIZATION NOTE (downloads.disabledInGuest): This message appears in a toast
# when the user tries to download something in Guest mode.
downloads.disabledInGuest=Downloads are disabled in guest sessions
-alertFullScreenToast=Press BACK to leave full-screen mode
-
# LOCALIZATION NOTE (alertSearchEngineAddedToast, alertSearchEngineErrorToast, alertSearchEngineDuplicateToast)
# %S will be replaced by the name of the search engine (exposed by the current page)
# that has been added; for example, 'Google'.
alertSearchEngineAddedToast='%S' has been added as a search engine
alertSearchEngineErrorToast=Couldn't add '%S' as a search engine
alertSearchEngineDuplicateToast='%S' is already one of your search engines
alertPrintjobToast=Printing…