test: add test and api_feature
definition for chrome.scripting.globalParams
(#41685)
chore: add test and api_feature for chrome.scripting.globalParams
This commit is contained in:
parent
b9c4b27781
commit
7032c0d03c
4 changed files with 49 additions and 0 deletions
|
@ -20,6 +20,27 @@ const handleRequest = async (request, sender, sendResponse) => {
|
|||
break;
|
||||
}
|
||||
|
||||
case 'globalParams' : {
|
||||
await chrome.scripting.executeScript({
|
||||
target: { tabId },
|
||||
func: () => {
|
||||
chrome.scripting.globalParams.changed = true;
|
||||
},
|
||||
world: 'ISOLATED'
|
||||
});
|
||||
|
||||
const results = await chrome.scripting.executeScript({
|
||||
target: { tabId },
|
||||
func: () => JSON.stringify(chrome.scripting.globalParams),
|
||||
world: 'ISOLATED'
|
||||
});
|
||||
|
||||
const result = JSON.parse(results[0].result);
|
||||
|
||||
sendResponse(result);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'registerContentScripts': {
|
||||
await chrome.scripting.registerContentScripts([{
|
||||
id: 'session-script',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue