1

In a Chrome Extension is there any way to get around sites that have a set CSP (like Facebook)? Basically I am trying to send a POST request from my chrome extension to my server when the user performs an action (CTRL+SHIFT+ALT + Click a link - this sends a request to my server which shortens the link clicked and returns a short URL).

What I'm currently doing is injecting a script into the current webpage which listens for the above and then performs the request. It works fine on pages which don't explicitly set their CSP.

Is there any way to send a message from a web accessible resource to my content script? Perhaps the content script won't have the same limitations as the injected script.

Polarize
  • 1,005
  • 2
  • 10
  • 27
  • I think this [post](http://stackoverflow.com/questions/17011185/post-request-on-facebook-com-in-chrome-extension-fails) might help you. Rob W's answer suggests using a background page. – AL. Apr 03 '16 at 07:20
  • Why are you injecting scripts instead of just using a content script? – abraham Apr 04 '16 at 04:10
  • As a relative noob to chrome extensions, I have no idea why I was injecting. I'm now using content & background scripts. – Polarize Apr 04 '16 at 19:34

0 Answers0