Closed
Bug 1147749
Opened 10 years ago
Closed 10 years ago
View source doesn't go through service worker interception
Categories
(Toolkit :: View Source, defect)
Tracking
()
RESOLVED
FIXED
mozilla44
| Tracking | Status | |
|---|---|---|
| firefox44 | --- | fixed |
People
(Reporter: ehsan.akhgari, Assigned: baku)
References
Details
Attachments
(1 file, 2 obsolete files)
|
10.30 KB,
patch
|
jduell.mcbugs
:
feedback-
|
Details | Diff | Splinter Review |
This means that if you try to view source a page that has been served through a service worker, you'll be viewing the source the latest version from the network.
| Assignee | ||
Updated•10 years ago
|
Summary: View source doesn't go through service worker interceotion → View source doesn't go through service worker interception
| Assignee | ||
Updated•10 years ago
|
Assignee: nobody → amarchesini
Updated•10 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 1•10 years ago
|
||
bz, I don't know if what I'm doing with the docshell makes sense or not.
It works, but maybe it's all an horrible hack.
Attachment #8659238 -
Flags: review?(bzbarsky)
| Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8659238 -
Attachment is obsolete: true
Attachment #8659238 -
Flags: review?(bzbarsky)
Attachment #8660126 -
Flags: review?(bzbarsky)
Comment 3•10 years ago
|
||
Comment on attachment 8660126 [details] [diff] [review]
viewSource2.patch
>+ * Returns true if this channel is the main for the current document.
"is the main one"?
>+ * This can happen also if the flags do not have the LOAD_DOCUMENT_URI bit.
Maybe "even if" instead of "also if".
>+ attribute boolean mainDocumentChannel;
I think this should be isMainDocumentChannel.
Also, the interaction with the loadFlags setter should be documented, so that people know they need to call this _after_ setting the loadFlags?
Alternately, we could just have the getter return true if either the setter was called with true or the load flags have LOAD_DOCUMENT_URI... Either way, need to document the exact behavior.
Probably good to get a necko peer to review the necko bits.
>+ nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(mChannel);
Just use mHttpChannel, if it's non-null.
>+nsViewSourceChannel::GetMainDocumentChannel(bool* aValue)
>+nsViewSourceChannel::SetMainDocumentChannel(bool aValue)
Why not forward to the underlying HTTP channel? Might be better that way.
Attachment #8660126 -
Flags: review?(jduell.mcbugs)
Attachment #8660126 -
Flags: review?(bzbarsky)
Attachment #8660126 -
Flags: review+
| Assignee | ||
Comment 4•10 years ago
|
||
Attachment #8660126 -
Attachment is obsolete: true
Attachment #8660126 -
Flags: review?(jduell.mcbugs)
Attachment #8661573 -
Flags: review?(jduell.mcbugs)
Comment 5•10 years ago
|
||
Comment on attachment 8661573 [details] [diff] [review]
viewSource2.patch
Review of attachment 8661573 [details] [diff] [review]:
-----------------------------------------------------------------
This patch really makes me want to gag :( It's not clear to me why we're not allowed to put more than one channel with LOAD_DOCUMENT_URI into a loadGroup (there's no code in LoadGroup.cpp that forbids it), but I'm assuming there's some reason (addon compat?) why you didn't follow the (to my mind) cleaner approach of handing this in the docshell (as in your first patch).
But my track record of quibbling with :bz is poor, and I'm guessing there's a good reason for the change in strategy. So I can live with this. But I'd like the alternative API semantics that bz suggested (see comment below). +r to next patch with no re-review needed if that's ok.
For now I'm giving this version a f- just because it makes me feel cleaner :)
::: netwerk/protocol/http/nsIHttpChannel.idl
@@ +254,5 @@
> + * This can happen even if the flags do not have the LOAD_DOCUMENT_URI bit.
> + * If you want to set this value, remember to do it after the loading flags
> + * because this value is overwritten but those flags.
> + */
> + attribute boolean isMainDocumentChannel;
> Alternately, we could just have the getter return true if either the setter
> was called with true or the load flags have LOAD_DOCUMENT_URI
I like this approach better. So let's do
/** Indicates whether channel should be treated as the main one for the
* current document. If manually set to true, will always remain true. Otherwise,
* will be true iff LOAD_DOCUMENT_URI is set in the channel's loadflags.
Rename mIsMainDocumentChannel -> mForceMainDocumentChannel and have the Getter function return true if it's set or if LOAD_DOCUMENT is set.
This is all assuming that no one will ever want to "force" not-main-document status on a channel. It doesn't look like that will ever be the case.
Attachment #8661573 -
Flags: review?(jduell.mcbugs) → feedback-
Comment 6•10 years ago
|
||
More that one LOAD_DOCUMENT_URI channel would probably make the logic in docloader very very confused.
| Assignee | ||
Comment 7•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in
before you can comment on or make changes to this bug.
Description
•