pageMods always fires on iframes, adds matchIFrames options

RESOLVED DUPLICATE of bug 543526

Status

Mozilla Labs
Jetpack Prototype
RESOLVED DUPLICATE of bug 543526
9 years ago
8 years ago

People

(Reporter: Morgan 'ARR!' Allen, Unassigned)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

9 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2b4) Gecko/20091124 Firefox/3.6b4 XPCOMViewer/0.9a
Build Identifier: 

IFrames in a page loaded from the same site will likely match again. This adds and options (defaulted off) to match IFrames.

Reproducible: Always

Steps to Reproduce:
jetpack.future.import('pageModes');
var options = 
{
 matches: [ 'http://*' ],
 matchIFrames: true
}
jetpack.pageMods.add(console.log, options);
Actual Results:  
Otherwise iframes will always match.
(Reporter)

Comment 1

9 years ago
Created attachment 417809 [details] [diff] [review]
Adds matchIFrame option to pageMods

Allows user to decided to match IFrames or not. Defaults to no.

Comment 2

8 years ago
Oh, man. Now that is an awesome little patch :)
Comment on attachment 417809 [details] [diff] [review]
Adds matchIFrame option to pageMods

Not matching iframes is the common case, and I've seen lots of extensions (not to mention core Firefox code) implement this kind of filtering on their own (including after being stung by bugs related to subdocument loads), so this is a great change that will simplify the majority of jetpacks using pageMods!

Two small issues:

1. The location check for subdocument loads should be on the subdocument location rather than the top document location, i.e. if I load foo.com, which loads a page from bar.com in an iframe, and I care about iframes but only about foo.com pages, I shouldn't be notified about the bar.com page.

2. This functionality applies to subdocuments loaded into frames in addition to iframes, and there may be other ways to load subdocuments (not including <script>, <link rel="stylesheet">, and <img> tags, which are part of the same "load group" internally but are not considered subdocuments), so I would call this matchSubdocuments or matchEmbeddedDocuments (preferring the former for brevity).

Updated

8 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 543526
You need to log in before you can comment on or make changes to this bug.