Hi everyone,
I have a question about declarativeNetRequest dynamic rules, according to the
doc, the dynamic rules should be persistent, my understanding is if user restart Chrome, the dynamic rules still persist.
I have a very simple dynamic rule to add a custom header to a specific url, like
chrome.declarativeNetRequest.updateDynamicRules({
addRules: [
{
id: 999,
priority: 1,
condition: {
resourceTypes: ["main_frame"],
},
action: {
type: "modifyHeaders",
requestHeaders: [
{
header: "X-EXT-VER",
operation: "set",
value: "6.30.0",
},
],
},
},
],
});
this works when I open Chrome, open a new tab and visit "
https://test.mydomain.com/home/", however, some of my users(windows user) reported that they create a shortcut of the url (like dragging the url directly to desktop), then they can open that url directly when Chrome is closed. In this case, the custom header is not set, after they refresh the page, the header is set correctly.
I suppose this might be a racing condition, is it possible that the moment that Chrome starts and load the page, the extension rules are still not applied?
If this is the case, any ideas how to fix it?
Thank you very much