Closed chunyuema closed 2 years ago
I am looking into this now, working on migrating the backend to use declarativeNetRequest API. I think I have a good idea of how to do this and can give an update at the meeting tomorrow.
@ekuller, thank you for looking into this. We also need to update the logic, which we depend on when updating the GPC signals. For example, the following caching mechanism is unlikely to work since the service worker does not maintain these global variables. I can look more into this.
This is also of interest to @kalicki1 and @OliverWang13.
@bella-tassone, @chunyuema, and I met on Saturday and discussed delegation of webRequest/GPC migration. These are the tasks I have come up with for the coming week:
domains
condition equal to an array of the appropriate domains dictated by the disconnect list; something like:
chrome.declarativeNetRequest.updateDynamicRules({addRules:[{
"id" : 1,
"action" : { "type" : "modifyHeaders",
"requestHeaders": [
{ "header": "Sec-GPC", "operation": "set", "value": "1" },
{ "header": "DNT", "operation": "set", "value": "1" }
]},
"condition" : {
"urlFilter" : "|*"
"domains": [LIST_OF_DOMAINS_TO_SEND_GPC_TO]
}
}], removeRuleIds:[1]
})
{chrome.runtime.sendMessage({greeting: "NEW RULE", d: currentDomain, id: domains[currentDomain].id})}
and {chrome.runtime.sendMessage({greeting: "RM RULE", id: domains[currentDomain].id})}
. When adding domains to the domain list they should now contain two properties: domains[currentDomain].id=Object.keys(domains).length+1
and domains[currentDomain].id
set to true or false dependent on whether we are sending GPC. Code that uses the values of domains[currentDomain]
currently should be updated to use the values of domains[currentDomain].id
(decent amount of refactoring). I can definitely help you with this.Nice plan and teamwork!
Note from the discussion yesterday
Very nice, @chunyuema! (Maybe, even put this, or a final version, in the readme as an architectural overview.)
The GPC signals are not updated for the extension as we still rely on the API that has been phased out since MV3. This issue attempts to address the upgrade of the WebRequest API to correctly append the GPC signal.