You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ZeroFrame currently monkey-patches AJAX browser APIs to add AJAX key. It would also be good to monkey-patch some other browser APIs, like localStorage or history, to call ZeroFrame's wrapper actions instead of directly browser APIs. This would make it possible to use some third-party libraries (like JS routers which use History API, maybe some storage helpers) with ZeroNet without any modifications to them (this currently requires to modify them to use ZeroFrame instead of browser APIs).
Some of APIs which should be monkey-patched are:
localStorage: Use wrapper's wrapperGetLocalStorage and wrapperSetLocalStorage. However, I don't know if this is possible because browsers prevent accessing and modifying localStorage object in iframe sandbox.
History: Use wrapperGetState, wrapperPushState, wrapperReplaceState and correctly handle URL rewrites in other History's objects. This would be easier because you can access them inside sandbox, but they just don't do anything.
As well as some other wrapper actions like wrapperOpenWindow and wrapperSetTitle.
The text was updated successfully, but these errors were encountered:
@HelloZeroNet Would it be possible to implement this, at least support for History API? I think that this would be quite useful, as it would enable you to use third-party JavaScript router libraries that currently don't work with ZeroNet.
But apart from just handling APIs, there should probably also be some good way of handling ? that is prepended to paths which won't mess up with libraries?
After some quick test it's possible to override window.history functions, but not the window.history object
So it could be possible, but I'm not sure if it will be compatible with every router as they could use window.location which is afaik not possible to override.
ZeroFrame currently monkey-patches AJAX browser APIs to add AJAX key. It would also be good to monkey-patch some other browser APIs, like
localStorage
orhistory
, to call ZeroFrame's wrapper actions instead of directly browser APIs. This would make it possible to use some third-party libraries (like JS routers which use History API, maybe some storage helpers) with ZeroNet without any modifications to them (this currently requires to modify them to use ZeroFrame instead of browser APIs).Some of APIs which should be monkey-patched are:
localStorage
: Use wrapper'swrapperGetLocalStorage
andwrapperSetLocalStorage
. However, I don't know if this is possible because browsers prevent accessing and modifyinglocalStorage
object in iframe sandbox.History
: UsewrapperGetState
,wrapperPushState
,wrapperReplaceState
and correctly handle URL rewrites in otherHistory
's objects. This would be easier because you can access them inside sandbox, but they just don't do anything.As well as some other wrapper actions like
wrapperOpenWindow
andwrapperSetTitle
.The text was updated successfully, but these errors were encountered: