Closed Bug 340749 Opened 18 years ago Closed 8 years ago

Need a way to do an openURI that can't be retargeted

Categories

(Core Graveyard :: Embedding: APIs, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: myk, Unassigned)

References

Details

Attachments

(1 file)

Currently, in order to invisibly parse an HTML page into a DOM document object, you have to:

1. download the content of the page (via f.e. XMLHttpRequest);
2. stick the content of the page into a data: URL;
3. create a hidden iframe (perhaps with JavaScript and other features disabled);
4. create a channel from the data: URL with the LOAD_BACKGROUND flag set;
5. call nsIURILoader::OpenURI, passing it the channel and the iframe's docShell.

Following this procedure prevents accidental display of the "download" dialog box (if your HTML page turns out to have a content type you weren't expecting), may have negligible impact on UI responsiveness (still in the process of testing this), and may prevent the cursor from changing into the busy cursor (still testing this, too).  But it's a painful way to obtain these benefits.

There should be an better way to do this.
So how is this different from bug 102699?

Or is this a bug about avoiding the "download" dialog?  We should definitely have an API on URILoader to allow that....
(In reply to comment #1)
> So how is this different from bug 102699?

Hmm, you're right, this bug, as currently stated, is the same as bug 102699.

> Or is this a bug about avoiding the "download" dialog?  We should definitely
> have an API on URILoader to allow that....

We can morph it to be that bug.
Assignee: mrbkap → nobody
Component: HTML: Parser → Embedding: APIs
QA Contact: parser → apis
Summary: a better way to invisibly parse HTML → Need a way to do an openURI that can't be retargeted
-> me, unless someone else wants it :)
Assignee: nobody → cbiesinger
Target Milestone: --- → mozilla1.9alpha
XMLHttpRequest's .responseDocument should just support text/html, IMHO.
this bug is now unrelated to XMLHttpRequest, implementing this new summary is useful independent of whether XMLHttpRequest supports text/html.
bug 384941 adds an openURIWithFlags function to which you can pass nsIURILoader::DONT_RETARGET
Depends on: 384941
Target Milestone: mozilla1.9alpha1 → ---
That bug doesn't have that change anymore, but I've separated it out into a separate patch.
Assignee: cbiesinger → nobody
Marking a bunch of bugs in the "Embedding: APIs" component INCOMPLETE in preparation to archive that component. If I have done this incorrectly, please reopen the bugs and move them to a more correct component as we don't have "embedding" APIs any more.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: