I'm writing an extension and I want part of the code to only run in iframes. Currently, all the code in my extensuin.js file runs in the page and iframes How can I detect that the code is running in an iframe so that I can run iframe specific code?
Just as an example (this is not real code) my extension.js should be something like:
appAPI.ready(function($) {
if (iframe) {
// Run iframe code
} else {
// Run on regular page
}
});