Closed Bug 642106 Opened 13 years ago Closed 10 years ago

default to locale-specific about:home for China

Categories

(Firefox :: General, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- -
status2.0 --- wanted

People

(Reporter: htang, Assigned: shaohua.wen)

References

Details

(Whiteboard: [about-home])

Attachments

(2 files, 6 obsolete files)

Hello,
We have been using a localized start page:  "http://zh-cn.start3.mozilla.com/firefox/?client=firefox-a&rls=org.mozilla:zh-CN:official" 
in FF3.x chinese simplified version for quite a while. 

We realized that in FF4.0 it start up "about:home" page which is quite different from what Chinese users are expecting for.

It is possible to keep this localized start page in FF4 chinese simplified version ? basically to open the URL (mentioned above) ? 
or 
the same kind page is also hosted by MozillaOnline in China:
http://i.firefox.com.cn 
It can be used as well, depending on which way is easier for you.

Thanks in advance for the consideration.
This would take code changes I believe (see bug 563723)
At a minimum it would require a repack of the Chinese localized builds to include an override of the homepage pref value. I don't think that's feasible at this point (and I'm not sure it's a good idea even if it were - having zh-CN builds behave differently than all others in this regard would be suboptimal).
Google service is terriblly slow and unstabale in China, since all China queries are redirected to Hong Kong Site.

In the localized start page, we provide users more options.
Whiteboard: [about-home]
Hello there,
Anyone can give us an update on this request ?
I am wondering if there is any chance to get it fixed before next 4.0 patch.
thanks.
Hong
blocking2.0: --- → ?
I don't see any realistic way for this to block Macaw if you want to merge the Chinese code into the built-in about:home code and then only show it in a single locale. That's a change that's going to take testing, and we currently don't even have an assignee.
blocking2.0: ? → -
status2.0: --- → wanted
Summary: Change request for FF4.0 start page (Chinese simplified) → default to locale-specific about:home for China
Attached patch patch (obsolete) — Splinter Review
Attached patch patch (obsolete) — Splinter Review
Add the ability to override about:* per locale and add an entry for zh-CN, zh-HK and zh-MO to point to Mozilla China's hosted start page. The Chinese market requires a different start page, and this is currently solved with an add-on. We should integrate this into the core directly, amongst others because the new Firefox/Android frontend won't have add-ons initially. The particular layout of the Chinese start page is not up for discussion in this bug. Thats a country/locale specific preference, and Mozilla China owns that feature. The decision to host the page online instead of embedded in the download is also not up for debate in this bug. Thats also for Mozilla China to decide.
Attachment #568800 - Attachment is obsolete: true
Hong, the attached patch redirects about:home to http://i.firefox.com.cn, however, this breaks relative urls and your start page doesn't render right. The easiest fix would be to use absolute urls in your start page, but I don't know whether that works with your mirroring setup. Can you talk to your webdevs about this? If they prefer to stick to relative urls, we can redirect about:home to a local file with a proper redirection to the final url (I wanted to avoid that since it might cause a small delay). Let me know if you need help testing this patch.
Attachment #568804 - Flags: review?(gavin.sharp)
Attached patch patch (obsolete) — Splinter Review
Better default in case pref reading fails.
Attachment #568804 - Attachment is obsolete: true
Attachment #568804 - Flags: review?(gavin.sharp)
Attachment #568820 - Flags: review?(gavin.sharp)
(In reply to Andreas Gal :gal from comment #8)
> Hong, the attached patch redirects about:home to http://i.firefox.com.cn,
> however, this breaks relative urls and your start page doesn't render right.
> The easiest fix would be to use absolute urls in your start page, but I
> don't know whether that works with your mirroring setup. Can you talk to
> your webdevs about this? If they prefer to stick to relative urls, we can
> redirect about:home to a local file with a proper redirection to the final
> url (I wanted to avoid that since it might cause a small delay). Let me know
> if you need help testing this patch.

Andreas,
Thanks a lot for the support and speedy response.
Our webdev is fixing the problem right now. I will let you know when we are ready. Thanks !
review ping
(In reply to Andreas Gal :gal from comment #8)
> Hong, the attached patch redirects about:home to http://i.firefox.com.cn,
> however, this breaks relative urls and your start page doesn't render right.
> The easiest fix would be to use absolute urls in your start page, but I
> don't know whether that works with your mirroring setup. Can you talk to
> your webdevs about this? If they prefer to stick to relative urls, we can
> redirect about:home to a local file with a proper redirection to the final
> url (I wanted to avoid that since it might cause a small delay). Let me know
> if you need help testing this patch.

Fixed the problem. 
Please use http://start.firefoxchina.cn instead. Only for zh-CN. 
Thanks !!!
(In reply to Andreas Gal :gal from comment #7)
> The decision to host the page online instead of embedded in the download is also
> not up for debate in this bug. Thats also for Mozilla China to decide.

Maybe so, but it's unnecessarily confrontational to frame things this way. We should all be working together to ensure that the default experience for Firefox users is optimal, and absolute statements about what is or isn't "up for debate" aren't helpful.

It would be good to know why Mozilla China feels that hosting the start page online is a better choice than embedding it into the product, given that we've made the opposite decision for Firefox proper. Building the page in doesn't necessarily imply that it couldn't be customized for Chinese users (to address comment 3), or updated periodically (as our release schedules allow).
Comment on attachment 568820 [details] [diff] [review]
patch

At the very least, this will break BrowserOnAboutPageLoad(), which expects about:home to be our hardcoded page. I'm also a little bit wary of the default snippet stuff, which exposes the snippets and default search engine information to about:home. If we go this route, it seems like it would be safer overall to change the home page pref itself, rather than changing the underlying URL for about:home.

(mozilla::Preferences::GetCString is the new preferred pref API BTW)
Attachment #568820 - Flags: review?(gavin.sharp) → review-
(In reply to Gavin Sharp (use gavin@gavinsharp.com for email) from comment #13)
> (In reply to Andreas Gal :gal from comment #7)
> > The decision to host the page online instead of embedded in the download is also
> > not up for debate in this bug. Thats also for Mozilla China to decide.
> 
> Maybe so, but it's unnecessarily confrontational to frame things this way.
> We should all be working together to ensure that the default experience for
> Firefox users is optimal, and absolute statements about what is or isn't "up
> for debate" aren't helpful.

I didn't say thats not up for debate. It very much is. _Just not in this bug_. This bug is about making the current Chinese setup work. If you have a good understanding of the Chinese market and what people expect from their start page, you should get in touch with Hong and her team. I am sure they are happy to discuss that and we can file follow-up bugs.

> 
> It would be good to know why Mozilla China feels that hosting the start page
> online is a better choice than embedding it into the product, given that
> we've made the opposite decision for Firefox proper. Building the page in
> doesn't necessarily imply that it couldn't be customized for Chinese users
> (to address comment 3), or updated periodically (as our release schedules
> allow).

Again, a good discussion to have in a different bug. I happen to agree. We should embed the Chinese site, it saves bandwidth and provides for faster tab loads. Bug again, not really what I am trying to solve with this bug, hence the clear statements about the scope of this bug (which is really all those were).
Attached patch patch (obsolete) — Splinter Review
Attachment #568820 - Attachment is obsolete: true
Attached patch patchSplinter Review
Attachment #569591 - Attachment is obsolete: true
I don't think we want a patch to tweak about:home to redirect to the world either.

If zh-CN really needs to have a different home-page than the rest, putting that URL into firefox-l10n.js in the localization should be the right thing to do.

BUT: browser.startup.homepage is handled as a localized pref only, but the properties file isn't in l10n anymore. That's kinda backwards. Can we make the users for that pref to fall back to the plain pref in case getComplexPref fails?

Example: In nsBrowserContentHandler.js' get startpage(), 
  get startPage() {
    var uri = Services.prefs.getComplexValue("browser.startup.homepage",
                                             nsIPrefLocalizedString).data;
raises an exception, and doesn't get to the 
    if (!uri) {

part. Which wouldn't help in this case, either.
comment #18: that won't allow to offer session restore as part of the start page UI, since its not "about:home", but its no worse than what they have now (they customize to a different start page using an addon), so its a strict improvement if we fix this at the l10n level. I am not opposed. If Gavin is more comfortable with this proposal, I will whip up a fix for the issues you mentioned.
It also works for us, thanks !
(In reply to Andreas Gal :gal from comment #19)
> strict improvement if we fix this at the l10n level. I am not opposed. If
> Gavin is more comfortable with this proposal, I will whip up a fix for the
> issues you mentioned.

Yes, this sounds good. We should simplify the home page pref stuff. Getting rid of browserconfig.properties and adding getCharPref fallback (and consolidating the code in browser.js's getHomePage and nsBrowserContentHandler's startPage getter) would be righteous. Then we can just make the firefox-l10n change Axel suggests for the relevant locales.
Ok, I am totally new to that code but I will take a stab. I might find you in the office tomorrow for additional pointers.
Please don't take this the wrong way, but this seems like a perfect "new bug" type of fix and I know we have engineers in the China office. I can think of a million other projects that Andreas can be on that are higher priority than this (though it is awfully nice of him to hop on it).

Andreas, can you hand this off? I doubt it would take even the greenest engineer over a week. Your attention is likely better spent elsewhere, and if this is a major going concern for China we have directed resources and can spec accordingly.

We need more China customization patches coming into mainline and this bug seems like a perfect candidate to start/continue the trend.
Sure, I am sure the China office is happy to work on this. I just want to make sure we see some action on this bug. It was filed over 6 months ago.
Yes, I will have our developer to look into it.
Andreas, really appreciate your help !
Hong, we can drive it through as well if you can't find resources. This also seems like a great bug for a community member to hop in.

Let me know which way you want to go and we'll hopefully get this in this week (to make fx10)
(In reply to Christian Legnitto [:LegNeato] from comment #26)
> Hong, we can drive it through as well if you can't find resources. This also
> seems like a great bug for a community member to hop in.
> 
> Let me know which way you want to go and we'll hopefully get this in this
> week (to make fx10)

We are getting there, and will send you the patch after we finish the testing.
It will be by the end of today (Beijing time). It is also good opportunity for our engineer to go through this process.
Thanks for the support and it will be great if we can get this in this week.
Attached patch patch for zh-CN (obsolete) — Splinter Review
By  following the  Axel Hecht's suggestion in  comment #18,
I have created a patch of localization (zh-CN) in the attachment.
It just put the new URL into firefox-l10n.js in the zh-CN version, instead of "about:home" redirection.
Please let me know for any suggestion.
Comment on attachment 570963 [details] [diff] [review]
patch for zh-CN

Review of attachment 570963 [details] [diff] [review]:
-----------------------------------------------------------------

I've tried a similar patch, but that didn't work, see my comment 18.

I'm putting this down as an r-, as this doesn't work as is. If we get a patch to the browser code so that it does work, please re-request review.
Attachment #570963 - Flags: review-
Attached patch patch for zh-CN (obsolete) — Splinter Review
This patch modify "browser.startup.homepage" to "chrome://branding/locale/brand.properties",and put the startup URL into 'brand.properties'

I've tested,no  exception raised at there(as comment 18).
Please re-review.
Attachment #570963 - Attachment is obsolete: true
Attachment #571226 - Flags: review?
Attached patch patch for zh-CNSplinter Review
This patch modify "browser.startup.homepage" to "chrome://browser/locale/browser.properties",and put the startup URL into 'browser.properties'

I move the startup URL to 'chrome://browser/locale/browser.properties'.
because it only work on official version and doesn't work on aurora and nightly version when we put the startup into brand.properties(as comment 30)

Please re-review this one instead
Attachment #571226 - Attachment is obsolete: true
Attachment #571226 - Flags: review?
Comment on attachment 571258 [details] [diff] [review]
patch for zh-CN

This should work as a zh-CN-only solution. It would be nice to implement the changes described in comment 21 so that this patch could be simpler (avoid the need for the browser.properties change), but we don't need to block on that.
Attachment #571258 - Flags: review?(l10n)
Attachment #571258 - Flags: feedback+
Comment on attachment 571258 [details] [diff] [review]
patch for zh-CN

Review of attachment 571258 [details] [diff] [review]:
-----------------------------------------------------------------

I *really* prefer to get gavin's stuff working, but this is good enough 'til that patch makes it through the channels.

One obvious caveat is that this patch will at least report an obsolete string on the dashboard, and it can, theoretically conflict with a landing of the same key in browser.dtd.
Attachment #571258 - Flags: review?(l10n) → review+
Thanks. 
How about to get this patch in for now and in the meantime we will try the change described in comment 21.
(In reply to Axel Hecht [:Pike] from comment #33)
> Comment on attachment 571258 [details] [diff] [review] [diff] [details] [review]
> patch for zh-CN
> 
> Review of attachment 571258 [details] [diff] [review] [diff] [details] [review]:
> -----------------------------------------------------------------
> 
> I *really* prefer to get gavin's stuff working, but this is good enough 'til
> that patch makes it through the channels.
> 
> One obvious caveat is that this patch will at least report an obsolete
> string on the dashboard, and it can, theoretically conflict with a landing
> of the same key in browser.dtd.

Does that prevent us from landing this now? Will the zh-CN localizers be confused by the new "obsolete" string? What would be the fallout of a conflict?
My r+ menat to say that we probably want the zh-CN patch in the meatime.

I'd rely on mozilla-online to sync with the localizers to resolve any confusion.

If the locliazer removes the obsolete string, there's no homepage, basically. fx comes up with about:blank.
Hong, do you have commit access to mozilla-central or do you want me to land this for you?
This needs to land in the zh-CN l10n repos, probably even starting in beta, and then merge back down to aurora and central (to not transplant without need).

Once we have a fix in fx to make this simpler, we need to land a patch in zh-CN that goes the new style, and let that bubble up the channels as usual.
(In reply to Christian Legnitto [:LegNeato] from comment #37)
> Hong, do you have commit access to mozilla-central or do you want me to land
> this for you?

No, we do not have commit access to mozilla-central, please help us land the patch.
thanks !
To clarify, the intermediate fix only needs to land on the zh-CN repo, no code changes on mozilla-central or friends is needed.
Hong has communicated with me, maybe I can take this but and help landing the patch, is that OK?
Assignee: nobody → shaohua.wen
Sure.
Aurora:

aurora/zh-CN$ hg ci -m "Bug 642106 - default to locale-specific about:home for China r=axel f=gavin.sharp"
browser/chrome/browser/browser.properties
browser/firefox-l10n.js
提交修改集 378:1e3144c6000a

Beta:
beta/zh-CN$ hg ci -m "Bug 642106 - default to locale-specific about:home for China r=axel f=gavin.sharp"
browser/chrome/browser/browser.properties
browser/firefox-l10n.js
提交修改集 617:abc8b39c1247
Shaohua Wen, will you land this patch on l10n-central as well?
I don't think the zh-CN team is working on central these days. As we don't automatically migrate l10n from central to aurora, that's fine.

Gavin, any suggestion on how to close in on comment 21, i.e., getting a better code support for this?
Any reason to leave this bug open?
Yes, it should be closed as it landed in all the channels already.
Br.
Holy
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Depends on: 1590128

Sorry to bother, but some medium have reported that Firefox will change users' setting of home page to https://start.firefoxchina.cn in background, even if users have chose another homepage, which is unintended.

I believed that this kind of behavior is against Mozilla's value and spirit. Is this a feature, a bug or just a fake news?

Flags: needinfo?(shaohua.wen)

(In reply to Yao Nianqing from comment #49)

Sorry to bother, but some medium have reported that Firefox will change users' setting of home page to https://start.firefoxchina.cn in background, even if users have chose another homepage, which is unintended.

I believed that this kind of behavior is against Mozilla's value and spirit. Is this a feature, a bug or just a fake news?

Hi, I've read the linked v2ex thread. STR as described by the original author:

  1. Default state is "Custom URLs…" and the url being "https://start.firefoxchina.cn/";
  2. Customize the homepage url;
  3. Select the "Firefox Home (Default)" option;
  4. Select the "Custom URLs…" option again, at which point the url is "https://start.firefoxchina.cn/", not their customized value.

Behind the scene, when they select the "Firefox Home (Default)" option, any customized value stored in the browser.startup.homepage pref is lost. At no point does Firefox change their customized homepage url WITHOUT their action.

I believe this is a misunderstanding, potentially caused by the preference UI, that the customized url might be kept intact while switching between "Firefox Home (Default)", "Custom URLs…", "Blank Page" and any extension provided homepage.

Flags: needinfo?(shaohua.wen)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: