This repository was archived by the owner on Aug 29, 2025. It is now read-only.
feat: disable cookie/localstorage access under restricted sandboxes#729
Merged
Marc-Andre-Rivet merged 1 commit intodevfrom Jan 15, 2020
Merged
feat: disable cookie/localstorage access under restricted sandboxes#729Marc-Andre-Rivet merged 1 commit intodevfrom
Marc-Andre-Rivet merged 1 commit intodevfrom
Conversation
7f267de to
d38659d
Compare
|
|
||
| if (props.storage_type === 'local') { | ||
| this._backstore = _localStore; | ||
| this._backstore = new WebStore(window.localStorage); |
Contributor
There was a problem hiding this comment.
The error message we get when trying to access localStorage is fairly informative / helpful:
Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': The document is sandboxed and lacks the 'allow-same-origin' flag.
I don't think it needs to be improved to make sense to an app developer and as such can be exposed as-is.
Contributor
|
Created plotly/dash#1088 for follow up. |
Contributor
Marc-Andre-Rivet
left a comment
There was a problem hiding this comment.
@josegonzalez Looks good. Just need two more things:
- a changelog entry under
## Unreleased-->### Changed - a branch update
23372eb to
39087e2
Compare
When dash is embedded into an iframe with a sandbox attribute that only has allow-scripts, cookie/localstorage access is disabled and dash-core-components fails to load. As such, we need to restrict our cookie/localstorage usage by disabling functionality. This patch moves the disabled functionality to a place where it doesn't get autoloaded regardless of usage, allowing dash-core-components to load in very restricted iframes.
39087e2 to
0aa79e8
Compare
JHSaunders
pushed a commit
to JHSaunders/dash-core-components
that referenced
this pull request
Mar 30, 2020
…lotly#729) When dash is embedded into an iframe with a sandbox attribute that only has allow-scripts, cookie/localstorage access is disabled and dash-core-components fails to load. As such, we need to restrict our cookie/localstorage usage by disabling functionality. This patch moves the disabled functionality to a place where it doesn't get autoloaded regardless of usage, allowing dash-core-components to load in very restricted iframes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When dash is embedded into an iframe with a sandbox attribute that only has allow-scripts, cookie/localstorage access is disabled and dash-core-components fails to load. As such, we need to restrict our cookie/localstorage usage by disabling functionality.
This patch removes the disabled functionality in a graceful manner, allowing dash-core-components to load in very restricted iframes.