Closed Bug 932208 Opened 12 years ago Closed 12 years ago

BrowserToolbar and HomeFragment context menu 'Share' option should be disabled for these protocols: about:// chrome:// file://

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
minor

Tracking

(firefox26 affected, firefox27 affected, firefox28 affected, firefox29 affected, firefox30 affected, firefox31 affected, firefox32 affected)

VERIFIED FIXED
Firefox 33
Tracking Status
firefox26 --- affected
firefox27 --- affected
firefox28 --- affected
firefox29 --- affected
firefox30 --- affected
firefox31 --- affected
firefox32 --- affected

People

(Reporter: AdrianT, Assigned: mcomella)

References

Details

Attachments

(4 files, 5 obsolete files)

4.59 KB, patch
mfinkle
: review+
Details | Diff | Splinter Review
7.17 KB, patch
mfinkle
: review+
Details | Diff | Splinter Review
4.86 KB, patch
mcomella
: review+
Details | Diff | Splinter Review
1.06 KB, patch
mcomella
: review+
Details | Diff | Splinter Review
Firefox Mobile 26 beta 1 Samsung Galaxy Tab 2 7.0(Android 4.1) Steps to reproduce: 1) Load any unsupported share protocols (e.g. about pages, local files etc) 2) Long tap on the url bar and from the context menu choose share Expected results: Just like for the Custom menu the share option is grayed out Actual results: The url can be shared
Probably need a new updated patch akin to bug 703630, but I sense a Finkle wontfix.
Summary: Unsupported share protocols can be shared from url bar content menu → Share option should be disabled for these protocols: about:// chrome:// file://
Since the bug 958517 , the share option has been removed from the URL context menu. However, I'm still able to reproduce this from the context menu triggered in top sites/bookmarks panels. Should we keep tracking this issue?
Flags: needinfo?(mark.finkle)
Flags: needinfo?(aaron.train)
Assignee: nobody → michael.l.comella
Flags: needinfo?(mark.finkle)
Summary: Share option should be disabled for these protocols: about:// chrome:// file:// → BrowserToolbar and HomeFragment context menu 'Share' option should be disabled for these protocols: about:// chrome:// file://
Flags: needinfo?(aaron.train)
(In reply to Mihai Pop from comment #2) > Since the bug 958517 , the share option has been removed from the URL > context menu. However, I'm still able to reproduce this from the context > menu triggered in top sites/bookmarks panels. Which context menu is this? When you long-click a top sites item or a bookmark? That seems correct to me.
Status: NEW → ASSIGNED
Flags: needinfo?(mihai.g.pop)
(In reply to Michael Comella (:mcomella) from comment #4) > (In reply to Mihai Pop from comment #2) > > Since the bug 958517 , the share option has been removed from the URL > > context menu. However, I'm still able to reproduce this from the context > > menu triggered in top sites/bookmarks panels. > > Which context menu is this? When you long-click a top sites item or a > bookmark? That seems correct to me. I think I was not clear enough in my previous comment. I was referring to about:pages in bookmark panel, and pinned top sites such as "about:firefox" or "about:config".
Flags: needinfo?(mihai.g.pop)
As per discussion with Ian via IRC.
Attachment #8417697 - Flags: review?(mark.finkle)
Comment on attachment 8417698 [details] [diff] [review] Part 2: Do not allow non-shareable links to be shared. We should be able to remove the contextmenu handler too: http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/BrowserApp.java#783 The mainmenu could still be using this one: http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/BrowserApp.java#2385 I'd like to see a new patch just we we verify the code is dead now.
Attachment #8417698 - Flags: review?(mark.finkle) → feedback+
Comment on attachment 8417697 [details] [diff] [review] Part 1: Remove Share from url bar context menu on pre-ICS. Damn. Added comment to wrong patch.
Attachment #8417697 - Flags: review?(mark.finkle) → feedback+
Comment on attachment 8417698 [details] [diff] [review] Part 2: Do not allow non-shareable links to be shared. >- menu.findItem(R.id.home_share).setVisible(!GeckoProfile.get(getActivity()).inGuestMode()); >+ if (!StringUtils.isShareableUrl(info.url, GeckoProfile.get(getActivity()).inGuestMode())) { >+ menu.findItem(R.id.home_share).setVisible(false); >+ } I am not a fan of this pattern. I'd rather separate the shareable URL concept and the guestmode concept. Can you switch to use this style: if (!StringUtils.isShareableUrl(info.url) || GeckoProfile.get(getActivity()).inGuestMode()) {
Attachment #8417698 - Flags: feedback+ → review-
Removed the contextmenu handler as per comment 8.
Attachment #8434466 - Flags: review?(mark.finkle)
Attachment #8434466 - Flags: review?(mark.finkle) → review+
Attachment #8434475 - Flags: review?(mark.finkle) → review+
Comment on attachment 8438055 [details] [diff] [review] Part 3: Fix testBookmarksPanel. Review of attachment 8438055 [details] [diff] [review]: ----------------------------------------------------------------- ::: mobile/android/base/tests/testBookmarksPanel.java @@ +18,5 @@ > for (String url : StringHelper.DEFAULT_BOOKMARKS_URLS) { > isBookmarkDisplayed(url); > } > > + assertAllContextMenuOptionsArePresent(StringHelper.DEFAULT_BOOKMARKS_URLS[1], I would add a comment either here or above the method, about checking both shareable and unshareable links. @@ +55,5 @@ > > + private void assertAllContextMenuOptionsArePresent(final String shareableURL, > + final String nonShareableURL) { > + mAsserter.ok(StringUtils.isShareableUrl(shareableURL), "Ensuring url is shareable", ""); > + mAsserter.ok(!StringUtils.isShareableUrl(nonShareableURL), "Ensuring url is shareable", ""); (you mentioned this already) "not shareable". @@ +69,5 @@ > + mActions.sendSpecialKey(Actions.SpecialKey.BACK); > + > + openBookmarkContextMenu(nonShareableURL); > + for (String contextMenuOption : StringHelper.BOOKMARK_CONTEXT_MENU_ITEMS) { > + if ("Share".equals(contextMenuOption)) { Add a comment here about skipping this item.
Attachment #8438055 - Flags: review+
It would be kinda neat to actually make these just "share" Firefox. i.e. send a link to the marketplace with some sort of "Firefox for Android rocks!" message :)
Attached patch imported patch _4-null (obsolete) — Splinter Review
Oh, it was a real bug. :D try: https://tbpl.mozilla.org/?tree=Try&rev=ddb416f9cf5c Later rebased part 3 (not in this try run); will upload.
Attachment #8439611 - Flags: review?(mark.finkle)
Attachment #8439613 - Flags: review+
Flags: needinfo?(michael.l.comella)
Attachment #8439611 - Flags: review?(mark.finkle) → review+
Verified as fixed on Firefox 33 Beta 4.
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: