Custom template or extension point?
See original GitHub issueHi! Thank you for this plugin, really useful and works well.
I would like to hook into the service worker code (I’d like to have custom logic in the fetch
listener), and I was wondering if there was any way to hook into it right now?
Thanks, William
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Creating and adding a scripted extension point
When developing an application, create scripted extension points and add them to the script includes in the application code.
Read more >Extension Points in a Storefront Page - Salesforce Help
This extension point is also known as the core template . ... To insert custom content here, use a Visualforce page include.
Read more >Creating custom extension points for Mac apps with ExtensionKit
To create a target for a custom extension point, you can pick the "Generic Extension" template from Xcode's new target dialog. Generic Extension ......
Read more >Extension points - Shopify.dev
Each extension point is triggered by a different merchant action, receives different data, and is responsible for handling a distinct part of the...
Read more >Creating an extension point - Client-side Extensions
Extension points allow you to provide a safe place for other developers to extend your UI with their own features. An extension point...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @willdurand,
Yes, you can have custom entry file for SW where you can handle
fetch
events as you want, but you cannot override behavior for assets listed incaches
option. i.e. if you do some API request and want to handle them in SW, just setServiceWorker.entry
option to some JS file, like this:and in
sw-handler.js
:Is it what you wanted?
Tracking cache mapping issue here now: https://github.com/NekR/offline-plugin/issues/59 Not sure about custom templates though, it reduces whole point of this plugin then since it’s an internal thing which depends on particular version of the plugin. I guess just forking plugin and adopt template for your app is fine.