The Same Origin Policy / Chapter 02 of 14

What should be Allowed?

What should be Allowed? in Pankaj Mouriya's Same Origin Policy guide.

All chapters ↘
  1. 01 / Introduction
  2. 02 / What should be Allowed?
  3. 03 / Same Origin Policy
  4. 04 / Access Different Orgins
  5. 05 / Same Origin Policy in Tabs
  6. 06 / Same Origin Policy to Anchors
  7. 07 / Same Origin Policy to Forms
  8. 08 / Same Origin Policy to Images and CSS
  9. 09 / Same Origin Policy to JavaScript
  10. 10 / Same Origin Policy to Web Storage
  11. 11 / Same Origin Policy to Cookies
  12. 12 / Getting Around Same Origin Policy
  13. 13 / postMessage API Implementation and limitations
  14. 14 / References

Before understanding or talking about same origin policy, lets ask below questions from ourselves

  • Should site A be able to embed site B? Yes
  • Should site A be able to link to site B? Yes
  • Should site A be able to embed site B and modify its contents? No
  • Should site A be able to submit a form to site B? Yes
  • Should site A be able to embed images from site B? Yes
  • Should site A be able to embed scripts from site B? Yes
  • Should site A be able to read data from site B? No

Try answering these questions at end of the talk. You will definetly feel more confident answering them lator