Closed Bug 1156546 Opened 7 years ago Closed 7 years ago

Remove "Developer Tools" preferences category when in Guest Mode

Categories

(Firefox for Android Graveyard :: Settings and Preferences, defect)

All
Android
defect
Not set
normal

Tracking

(firefox42 fixed)

RESOLVED FIXED
Firefox 42
Tracking Status
firefox42 --- fixed

People

(Reporter: mcomella, Assigned: enr0n, Mentored)

References

Details

(Whiteboard: [good first bug][lang=java])

Attachments

(1 file)

STR:

1) Open guest mode
2) 3-dot menu, settings
3) Click developer tools (which says remote debugging)

Expected: Remote debugging exists in the developer tools sub-menu
Actual: It doesn't

Did not check for other discrepencies in the menu.

Potential fixes:
  1) Have another settings summary string for guest mode and non-guest mode
  2) Show a disabled developer tools menu item (but how do we communicate that it's disabled because of guest mode?)
  3) Simplify settings to remove sub-menus so we don't have this problem
4) Just remove "Developer Tools" when Guest Browsing
IIRC remote debugging was deliberately removed when guest browsing — it would allow all kinds of shenanigans. We don't let you load about:config, either.

So yes, mfinkle's (4) is totally correct: remove Developer Tools altogether.
Mentor: rnewman
Component: General → Settings and Preferences
Summary: [guest] Settings says "Remote debugging" in Developer Tools item summary even when it's disabled in guest mode → Remove "Developer Tools" preferences category when in Guest Mode
Whiteboard: [goo
Goddamn Chrome.
Whiteboard: [goo → [good first bug][lang=java]
(In reply to Richard Newman [:rnewman] from comment #2)
> IIRC remote debugging was deliberately removed when guest browsing — it
> would allow all kinds of shenanigans. We don't let you load about:config,
> either.

If you have access to someone's unlocked phone, you can do all sorts of shenanigans (hell, you could even just uninstall their Firefox). We need to remember that guest mode isn't about security, it's about an easy way to avoid your friend's junk from ending up in your browser profile.

I'm not a big fan of all the one-off logic we add to disable things in guest mode, but yes, removing developer tools altogether would be better than just removing remote debugging.
See also: bug 1157531.
Hello,

I'm new here, and I think this could be a good bug for me to get started with. I've gone through the build instructions so I should be good to go.

Can anyone offer me some further guidance? It would be greatly appreciated!
Flags: needinfo?(rnewman)
Hi Nicholas!

If you've got a local build working and running on your device, then yes, you're good to go!

This bug is to make changes to mobile/android/base/preferences/GeckoPreferences.java to disable the developer tools during Guest Mode.

This'll be around line 674, inside the PreferenceGroup check.

The preferences are preferences_devtools.xml. You'll have to use a debugger or print statements to figure out which input to check -- that's the fun part!
Flags: needinfo?(rnewman)
Thanks! So looking into the code I see that there is no preference on developer tools alone, only remote debugging. So should I create a new preference for developer tools as a whole, and add a new restriction for that within RestrictedProfiles.java? 

Let me know if I'm on the right track, thanks!
Flags: needinfo?(rnewman)
Over to Chenxia. Sorry for the slow turnaround!
Mentor: rnewman → liuche
Flags: needinfo?(rnewman) → needinfo?(liuche)
Nicholas, the way that preferences on Android works is that we have a set of xml files in mobile/android/base/resources/xml* of the form preference*.xml which describe how to lay out these preferences in Settings.

(Notice that there's also an xml-v11/preferences.xml file)
http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/resources/xml/preferences.xml?force=1#74

You'll want to hide this category/preference when Guest Mode is enabled.
Flags: needinfo?(liuche)
Sorry this has been slow, but I fixed the bug and tested it on my device. I'm not entirely sure where to go from here as far as submitting for review and that sort of thing.

Thanks for the help you all have been awesome!
Hi Nicholas, take a look at this wiki page on submitting patches - let me know if you have any more questions!
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/How_to_Submit_a_Patch#Committing_the_patch
Attached patch Possible patchSplinter Review
Attachment #8629212 - Flags: review?(liuche)
Assignee: nobody → nrosbrook
Comment on attachment 8629212 [details] [diff] [review]
Possible patch

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

Nice! This looks great and works for me.
Attachment #8629212 - Flags: review?(liuche) → review+
In the future, make sure there is a commit message for the patch, as mentioned in the section on patches: https://wiki.mozilla.org/Mobile/Fennec/Android#Creating_commits_and_submitting_patches
https://hg.mozilla.org/mozilla-central/rev/77f6cbd28d13
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 42
(In reply to Chenxia Liu [:liuche] from comment #15)
> In the future, make sure there is a commit message for the patch, as
> mentioned in the section on patches:
> https://wiki.mozilla.org/Mobile/Fennec/
> Android#Creating_commits_and_submitting_patches

Will do, thanks.
Thank you all again for the help it has been much appreciated.
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.