Skip to content

Chrome: Enable rendering in cross-origin iframes #124

@adam-p

Description

@adam-p

Attempts to render Markdown in a different-origin-than-topmost-page iframe results in silent failure and console error output. This causes problems for Wordpress's drop-down editor, Google Groups that are embedded in a webpage, and probably other cases (also embedded Google Hangouts, but that barely works anyway).

This problem isn't present in the Firefox extension. I'm not sure about the Safari extension.

It will probably be necessary to use the all_frames for content_scripts in manifest.json. This will need tons of testing and will probably need changes/fixes to compensate for the content scripts being loaded multiple times in a page.

A tip from this SO answer:

"In case you just need javascript injected in iframe but not in top document you can check inside your content_frame.js file like this:"

if (parent === top) {
    // here you can put your code that will run only inside iframe
}

EDIT:
Also affects function in Disqus embedded comments. MDH doesn't work in Disqus anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions