-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
I have monkey patched the interceptable_request? method in the Hotwire::Spark::Middleware to filter out certain paths. I user lookbook to preview viewcomponents, Lookbook adds some chrome to navigate component previews and the component preview is iframed inside the chrome. I didn't want spark to inject itself in the outer page so I added a extension module as shown below. It is a bit hacky, and wondered whether I should create a PR to add a configuration option to allow filtering of URLs? If you think this is worthy please let me know and I ca n put together a PR.
module HotwireSparkExtensions
private
def interceptable_request?
super && !@request.fullpath.start_with?('/component-previews/inspect')
end
end
class Hotwire::Spark::Middleware
prepend HotwireSparkExtensions
endMetadata
Metadata
Assignees
Labels
No labels