LavaMoat / snow

Use Snow to finally secure your web app's same origin realms!
https://lavamoat.github.io/snow/demo/
MIT License
102 stars 9 forks source link

Support multiple callbacks to Snow #71

Closed weizman closed 1 year ago

weizman commented 1 year ago

Background

In sake of simplicity and security, up until this point Snow only accepted one single callback (first one to register wins). We now need Snow to be able to accept more than just one without breaking its security principles.

Solution

Example

SNOW( w => false ) // will be called on top and all future same origin realms (false continues the chain)
SNOW( w => true  ) // will be called on top and all future same origin realms (true breaks the chain)
SNOW( w => false ) // will be called on top and top only! (true broke the chain)
SNOW( w => false ) // will be called on top and top only! (true broke the chain)