I'm developing a browser extension and I need certain parts of the code to only execute within iframes. Currently, all the code in my extension.js file is executed on both regular web pages and iframes. How can I identify whether the code is running within an iframe so that I can execute specific iframe-related code?
For instance, here's a snippet of what I envision for my extension.js:
appAPI.ready(function($) {
if (iframe) {
// Execute iframe-specific code
} else {
// Execute code on the regular web page
}
});