phoenixframework / phoenix_live_reload

Provides live-reload functionality for Phoenix
MIT License
315 stars 90 forks source link

Allow adding custom attributes to iframe #104

Closed hauleth closed 4 years ago

hauleth commented 4 years ago

This would be useful for situations when there is used dynamic reload tooling like Turbolinks used as it would prevent needless updates of iframe.

josevalim commented 4 years ago

Sure, PR is welcome! I think we already have an app env for config. But it may be able to go to the plug too.

hauleth commented 4 years ago

102 was the base for that. I created that issue for me, but I cannot assign myself to it.

mbramson commented 4 years ago

Confirming this would be useful to be able to add a nonce to the iframe to satisfy a content security policy.

josevalim commented 4 years ago

Are you sure a nonce is necessary? The iFrame is hosted in the same app and the contents of the iFrame are applied to the policy returned by the iFrame. If your CSP plugs comes after the live reload one, you should be good.