0

Using a Chrome extension, I wish to extract information from a large number (20 to >100) of pages all linked to from a list in one page, and then present that compiled info on a new page created by the extension. The original page with the link list and its linked subpages are not owned by me and I cannot influence their settings in any way.

In a previous similar situation, I have managed to solve this by creating one <iframe> element for each subpage and setting the styles for those iframes to {display:none;} such that the extension's page doesn't get visually cluttered while it extracts the desired info. This time however, I get the error message Refused to display '<URL>' in a frame because it set 'X-Frame-Options' to 'deny'. The iframe approach thus seems doomed here.

Therefore I tried the more brutal option to temporarily create a new tab for each subpage using window.open(); . It works, but it looks horrible, what with scores of tabs being generated instantly. Is there any operation I could make on the tabs corresponding to the css hiding of the iframes, such that the generated tabs are not shown? Because of security limitations, cURL won't work.

Subsequent edit: The stated question, about hiding tabs, I guess is answered in the negative; however, the problem that made me pose that question (the header restrictions against putting content in iframes) was solved by the answer to this post.

danbae
  • 563
  • 2
  • 8
  • 22
  • I actually doubt that you can instruct a browser to make a new tab and not show it but somehow have it exist. Imagine the security problems if this was allowed. – gforce301 Jan 16 '20 at 21:27
  • 1
    Are you positive you can't use [XHRs](https://developer.chrome.com/extensions/xhr) to get the information instead? –  Jan 16 '20 at 21:29
  • @ChrisG: I can get the primary output from the subpages using jQuery `$.get()` but those data are not the final page contents – they are mainly strings of calls to external javascripts, like ``. I do not know how to go from there to the actual page without letting the browser render the page in an iframe (not possible here) or a window/tab. Do you? – danbae Jan 16 '20 at 22:57

0 Answers0