-1

Is a chrome extension able to display different iframes, though through of which one is able to select different iframes in a menu bar inside the chrome extension? I’d appreciate any helenter image description herep ! :) If so, how can it be done ? Do I need to use JavaScript or is it done in the html file fullly? I’d very much appreciate an example :)

2 Answers2

0

Yes but no, the content scripts will NOT execute in the iframes loaded dynamically via JavaScript in the page, only the html i think.

reference: https://stackoverflow.com/a/8917679/4674037

Stephen
  • 889
  • 8
  • 18
  • How can I display each iframe as a separate menu option? Here is my code, imagine I want to display different iframes as an option menu bar, where when I press, depending on which option in the menu, it displays a certain iframe. I attached the html page to the original question! Please help me it would mean the world – mohammad abouelafia Dec 04 '17 at 02:06
  • Are you trying to display them when a user clicks it or when you open the menu? Whats so important that you need to display it in every single iframe instead of just using that source? – Stephen Dec 05 '17 at 00:27
  • No, I have a little project I am working on, where anyone downloading my chrome extension is able to view "live" scores for sports. The only supported API is payed for (too expensive) and so I resulted in a free score version for different sports (soccer, football and the like), however I don't want to display the iframes as one very long html file. I would rather have a menu popup as soon as the chrome extension is opened and enabling the user to decide which sport he wants to view. So i want to be able to display each iframe separately. Is that possible? If so can you show me an example? – mohammad abouelafia Dec 05 '17 at 01:47
0

an iFrame is the separate web page with a separate URL. You can not get iFrame content, but you can integrate your chrome extension directly into iFrame through URL in the manifest file. In this way, your extension will work with iFrame content as usual.

Aleksandr Golovatyi
  • 1,033
  • 1
  • 11
  • 18