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)
Core
Networking
Tracking
()
RESOLVED
FIXED
People
(Reporter: steffen.wilberg, Assigned: steffen.wilberg)
References
()
Details
Attachments
(1 file, 1 obsolete file)
7.96 KB,
patch
|
asaf
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
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.
Assignee | ||
Comment 1•15 years ago
|
||
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
Comment 2•15 years ago
|
||
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).
Assignee | ||
Comment 3•15 years ago
|
||
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 4•15 years ago
|
||
Comment on attachment 420831 [details] [diff] [review]
v1
Looks good. Thanks for doing this!
Attachment #420831 -
Flags: superreview?(bzbarsky) → superreview+
Comment 5•15 years ago
|
||
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
Comment 6•15 years ago
|
||
Comment on attachment 420831 [details] [diff] [review]
v1
r=mano
Attachment #420831 -
Flags: review?(mano) → review+
Assignee | ||
Comment 7•15 years ago
|
||
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•