- From: Yoshisato Yanagisawa <notifications@github.com>
- Date: Mon, 24 Nov 2025 22:09:41 -0800
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Tuesday, 25 November 2025 06:09:45 UTC
yoshisatoyanagisawa left a comment (w3c/ServiceWorker#1793)
Thanks for the reply. To be clear, actual code to check the supported condition might be:
```
function isNewPropertySupported(installEvent, propertyName) {
const newPropertyError = new Error('newPropertyError');
const conditionWithNewProperty = { };
Object.defineProperty(conditionWithNewProperty, propertyName, {
get: function() { throw newPropertyError; }
});
const throwingCondition = {
get urlPattern() { throw new Error('expectedError'); }
};
const routes = [
{
condition: conditionWithNewProperty,
source: "network"
},
{
condition: throwingCondition,
source: "network"
}];
return installEvent.addRoutes(routes).catch(e => {
return e === newPropertyError;
});
}
```
Yeah, we assume the urlPattern condition and the network source are always supported.
--
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1793#issuecomment-3573917087
You are receiving this because you are subscribed to this thread.
Message ID: <w3c/ServiceWorker/issues/1793/3573917087@github.com>
Received on Tuesday, 25 November 2025 06:09:45 UTC