Closed Bug 538421 Opened 15 years ago Closed 15 years ago

Add a nsIAboutModule flag to hide about: pages from about:about

Categories

(Core :: Networking, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: steffen.wilberg, Assigned: steffen.wilberg)

References

()

Details

Attachments

(1 file, 1 obsolete file)

about:about (aboutAbout.xhtml) uses a hardcoded blacklist for "about" pages which aren't useful to show because they require query strings ("blank", "blocked", "cache-entry", "certerror", "feeds", "neterror"). bz suggested to add a new nsIAboutModule flag instead.
Attached patch doesn't build (obsolete) — Splinter Review
I added the flag HIDE_FROM_ABOUTABOUT to nsIAboutModule.idl and the respective protocol handlers. But how do I access this flag from script? Error: Components.classes['@mozilla.org/network/protocol/about;1'] is undefined Source file: about:about Line: 21 I experimented a bit with nsNetCID.h and nsNetModule.cpp, but the build fails with this error: m:/trunk/netwerk/build/nsNetModule.cpp(1033) : error C2065: 'nsIAboutModuleConst ructor' : undeclared identifier That's not really surprising, but I don't know how to continue from here.
Assignee: nobody → steffen.wilberg
I don't think you need the nsNetCID/nsNetModule changes. Once you've added the flags, I think this should work in the js: if (result) { var aboutType = result[1]; var contract = "@mozilla.org/network/protocol/about;1?what=" + aboutType; try { var am = Components.classes[contract] .getService(Components.interfaces.nsIAboutModule); var uri = newURI("about:"+aboutType); var flags = am.getURIFlags(uri); if (!(flags & Components.interfaces.nsIAboutModule.HIDE_FROM_ABOUTABOUT)) { gProtocols.push(aboutType); } } catch (e) { // getService might have thrown if the component doesn't actually // implement nsIAboutModule } } where "newURI" is whatever the current best way of doing that in JS is (using NetUtil or manually via ioservice or whatever).
Attached patch v1Splinter Review
Thanks for your help, Boris! I don't think using NetUtil.jsm to call newURI provides much benefit here, apart from making the second and third argument optional.
Attachment #420629 - Attachment is obsolete: true
Attachment #420831 - Flags: superreview?(bzbarsky)
Attachment #420831 - Flags: review?(mano)
Comment on attachment 420831 [details] [diff] [review] v1 Looks good. Thanks for doing this!
Attachment #420831 - Flags: superreview?(bzbarsky) → superreview+
Please add nsIAboutModule::HIDE_FROM_ABOUTABOUT to "licence" (with a 'c') so that both "license" and "licence" aren't displayed. This will fix bug 538926.
Blocks: 538926
Attachment #420831 - Flags: review?(mano) → review+
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
No longer blocks: 538926
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: