How to get / set global settings for Google Chrome content for images in the extension?

I wrote an extension for Google Chrome to enable and disable image downloads using the Browser Action button.

It works, but so far I can set and get the value for specific pages at the url. These settings are displayed using the Manage exceptions ... button in the Settings section > Console> Privacy> Content settings ...> Images . For example,

chrome.contentSettings['images'].get({
    'primaryUrl': 'http://www.example.com/*',
    'incognito': false
},
function(details) {
    console.log('Show images: ' + details.setting);
});

displays the message "Show images: allow" or "Show images: block".

But I would like to turn global setting on and off. Therefore, I need to know if the value is "Show all images (recommended)" or "Do not show images" in the Settings> In the "End"> "Privacy"> "Content Settings ..."> "Images" , etc. e., is it allowed or blocked by default?

Various attempts to use wildcards for primaryUrl, for example, the following cause an error:

chrome.contentSettings['images'].get({
    'primaryUrl': '*://*/*',
    'incognito': false
},
function(details) {
    console.log('Show images: ' + details.setting);
});

ERROR:

'Error during contentSettings.get: The URL "*://*/*" is invalid.'

The link to Content Settings and Match Patterns allows me to think. I need to use a special template <all_urls>, but I also get errors.

+3
1

contentSettings.get 'http://*' URL- . '<all_urls>' primaryPattern contentSettings.set.

function toggleImages(tab) {

    chrome.contentSettings['images'].get({
        primaryUrl: tab.url
    }, function (details) {
        chrome.contentSettings['images'].set({
            primaryPattern: '<all_urls>',
            setting: details.setting == 'allow' ? 'block' : 'allow'
        })
    });

}

chrome.browserAction.onClicked.addListener(toggleImages);
+2