Open Bug 1241905 Opened 8 years ago Updated 2 years ago

nsIContentPolicy shouldLoad not detecting TYPE_DOCUMENT correctly

Categories

(Core :: XPCOM, defect)

43 Branch
x86
macOS
defect

Tracking

()

UNCONFIRMED

People

(Reporter: josesigna, Unassigned)

Details

Attachments

(1 file)

7.93 KB, application/x-xpinstall
Details
Attached file 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.
OS: Unspecified → Mac OS X
Hardware: Unspecified → x86
Version: 42 Branch → 43 Branch
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
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.
Attachment #8711020 - Attachment mime type: application/zip → application/x-xpinstall
Jose, can you please clarify how you identify the "main_frame".
Flags: needinfo?(josesigna)
(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)
Component: Untriaged → XPCOM
Product: Firefox → Core
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: