From adfc19c5fc70dda3e0996e47e447440098aa81b9 Mon Sep 17 00:00:00 2001 From: Margaret Leibovic Date: Thu, 26 Jul 2012 14:57:34 -0700 Subject: [PATCH] Bug 777805 - Update error message for unsupported plugins to include "Learn More..." link. r=mbrubeck --- mobile/android/chrome/content/browser.js | 17 +++++++++++++++++ .../en-US/chrome/mozapps/plugins/plugins.dtd | 11 +++++++++-- .../mozapps/plugins/content/pluginProblem.xml | 4 +++- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 9c13181719af..3e7eae863698 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -2161,6 +2161,7 @@ Tab.prototype = { this.browser.addEventListener("scroll", this, true); this.browser.addEventListener("MozScrolledAreaChanged", this, true); this.browser.addEventListener("PluginClickToPlay", this, true); + this.browser.addEventListener("PluginNotFound", this, true); this.browser.addEventListener("pageshow", this, true); Services.obs.addObserver(this, "before-first-paint", false); @@ -2253,6 +2254,7 @@ Tab.prototype = { this.browser.removeEventListener("DOMWillOpenModalDialog", this, true); this.browser.removeEventListener("scroll", this, true); this.browser.removeEventListener("PluginClickToPlay", this, true); + this.browser.removeEventListener("PluginNotFound", this, true); this.browser.removeEventListener("MozScrolledAreaChanged", this, true); Services.obs.removeObserver(this, "before-first-paint"); @@ -2801,6 +2803,21 @@ Tab.prototype = { break; } + case "PluginNotFound": { + let plugin = aEvent.target; + plugin.clientTop; // force style flush + + // On devices where we don't support Flash, there will be a "Learn More..." link in + // the missing plugin error message. + let learnMoreLink = plugin.ownerDocument.getAnonymousElementByAttribute(plugin, "class", "unsupportedLearnMoreLink"); + if (learnMoreLink) { + let learnMoreUrl = Services.urlFormatter.formatURLPref("app.support.baseURL"); + learnMoreUrl += "why-cant-firefox-mobile-play-flash-on-my-device"; + learnMoreLink.href = learnMoreUrl; + } + break; + } + case "pageshow": { // only send pageshow for the top-level document if (aEvent.originalTarget.defaultView != this.browser.contentWindow) diff --git a/toolkit/locales/en-US/chrome/mozapps/plugins/plugins.dtd b/toolkit/locales/en-US/chrome/mozapps/plugins/plugins.dtd index 9c97933cbc16..f4a80d19f05c 100644 --- a/toolkit/locales/en-US/chrome/mozapps/plugins/plugins.dtd +++ b/toolkit/locales/en-US/chrome/mozapps/plugins/plugins.dtd @@ -20,9 +20,16 @@ + + + + + + + - - diff --git a/toolkit/mozapps/plugins/content/pluginProblem.xml b/toolkit/mozapps/plugins/content/pluginProblem.xml index 8fc3ee0b1559..5c151bf92356 100644 --- a/toolkit/mozapps/plugins/content/pluginProblem.xml +++ b/toolkit/mozapps/plugins/content/pluginProblem.xml @@ -5,8 +5,10 @@ + %pluginsDTD; %globalDTD; + %brandDTD; ]> &missingPlugin; - &unsupportedPlatform; + &unsupportedPlatform.pre;&unsupportedPlatform.learnMore;&unsupportedPlatform.post; &tapToPlayPlugin; &clickToPlayPlugin; &clickToPlayPluginVulnerableUpdateAvailable;