- Inline Frames
- Editing a Framed Page
- Find the URL of the iframe
- Opening the Framed Document in its Own Tab
- Editing from the Top-Level Tab
- Cross-frame Communication
Inline Frames
An iframe (inline frame) is used to embed a document inside the current document. The embedded document can be from the same site, or a different site.
Framed document are separate/distinct from the top-level tab. A separate “instance” of PixieBrix runs in each iframe.
The Page Editor works on the top-level frame of the tab. It cannot directly select/modify elements in the document embedded within an iframe.
In selection/placement mode, when part of the page is an iframe, PixieBrix will highlight the whole iframe on hover because to the Page Editor, the iframe is a single element:
Editing a Framed Page
IFrames are distinct documents. To edit a document in an iframe with PixieBrix, you’ll edit the document and not the containing tab.
To extend a framed document with PixieBrix, you have two options:
- Preferred: Open the framed document in its own tab and use the Page Editor
- Use the Page Editor on the top-level tab, and manually write element selectors
Find the URL of the iframe
- Use the Chrome Dev Tools element selector
- Select an element within the frame
- Find the iframe ancestor element. It will have tag
<iframe>
and show a#document
sub node: - Right click the
src
attribute value and click “Copy link address”. This will copy a link address to the clipboard (including the origin if thesrc
attribute does not already include it)
Opening the Framed Document in its Own Tab
- Find the URL of the iframe (see above)
- Open a new tab and navigate to the document URL
- Open the Page Editor and edit the page as usual
Editing from the Top-Level Tab
- Find the URL of the iframe (see above)
- Add the mod in the Page Editor
- Modify the “Sites” to match the source of the framed document
- Build the mod as normal, but manually write elements selectors. (Because the Page Editor cannot select elements in iframes)
- Save the Mod
- Right click on the frame and select “Reload Frame” from the Chrome context menu:
- Your Mod will run inside the framed document
Cross-frame Communication
Coming Soon!