nsIContentPolicy shouldLoad not detecting TYPE_DOCUMENT correctly

UNCONFIRMED
Unassigned

Status

()

UNCONFIRMED
3 years ago
3 years ago

People

(Reporter: josesigna, Unassigned)

Tracking

43 Branch
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

7.93 KB, application/x-xpinstall
Details
(Reporter)

Description

3 years ago
Created attachment 8711020 [details]
test.xpi

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36

Steps to reproduce:

Using nsIContentPolicy shouldLoad to detect the load of main_frames (actual tab URLs).
Using nsIContentPolicy.TYPE_DOCUMENT is true in some cases where the resource loading is not an actual main_frame (see attached example).


Actual results:

On some websites, some resources are detected as main_frames when they are not.

For example:
1. Go to TMZ.com
2. Wait for the page to load
3. See that "http://trc.taboola.com/tmz/log/3/available" is detected as a main_frame


Expected results:

Only main_frame resources should be detected as such.
(Reporter)

Updated

3 years ago
OS: Unspecified → Mac OS X
Hardware: Unspecified → x86
(Reporter)

Updated

3 years ago
Version: 42 Branch → 43 Branch
(Reporter)

Comment 1

3 years ago
Another example:
1. Go to msn.com
2. "http://trc.taboola.com/msn-msn-home/log/3/visible" will be detected incorrectly as a main_frame
(Reporter)

Comment 2

3 years ago
Something that may be worth noting is that both of those incorrectly detected resources had this header:
P3P: policyref="http://trc.taboola.com/p3p.xml", CP="NOI DSP COR LAW NID CURa ADMa DEVa PSAa PSDa OUR BUS IND UNI COM NAV INT DEM"

I wonder if that's causing the problem.

Updated

3 years ago
Attachment #8711020 - Attachment mime type: application/zip → application/x-xpinstall
Jose, can you please clarify how you identify the "main_frame".
Flags: needinfo?(josesigna)
(Reporter)

Comment 4

3 years ago
(In reply to Brindusa Tot from comment #3)
> Jose, can you please clarify how you identify the "main_frame".

Yes, I have this code inside shouldLoad:

// ...
shouldLoad: function (type, contentLocation, requestOrigin, context, mimeTypeGuess, extra) {
  if (type === Ci.nsIContentPolicy.TYPE_DOCUMENT) {
    // main_frame-specific code
  }
}
// ...
Flags: needinfo?(josesigna)

Updated

3 years ago
Component: Untriaged → XPCOM
Product: Firefox → Core
You need to log in before you can comment on or make changes to this bug.