-1

Is it possible to create an extension for google chrome that can copy the html code of the current page and post it to a server ?

Haibara Ai
  • 10,703
  • 2
  • 31
  • 47
FrenchTechLead
  • 1,118
  • 3
  • 13
  • 20
  • what have you investigated and tried so far? – Zig Mandel May 19 '16 at 00:44
  • I aim to scrap all images in a web page that need authentification. I've started by using an iframe to get the web page with the images, but i realised that getting the content of an iframe is impossible when the domain name is different. So i am now doing it manualy by coping the source code of the page after authentification and post it to my php script. – FrenchTechLead May 19 '16 at 00:51
  • Now i had the idea that the dom content might be accessible by an extension, and this same extension might be able to post it (ajax) to my server, so i'm just asking people with experience if this is possible before starting to code. – FrenchTechLead May 19 '16 at 00:53
  • And now i now that i can use the content script to access the dom elements of a web page, and i'm still reading... – FrenchTechLead May 19 '16 at 01:16

1 Answers1

0

See Chrome Extension - Get DOM content for an explanation using a content script, which has access to the DOM, and a background page to send and receive messages between. On the callback to sendMessage, you should be able to make an AJAX POST to the server with your data.

Community
  • 1
  • 1
Gideon Pyzer
  • 22,610
  • 7
  • 62
  • 68