This simple extension allows you to ping your favorite websites.Single click to know availability and response time of any web resource!As simple as that. Enjoy!Changelog - v0.5 - Background worker and Chrome notifications - v0.4 - JSON Import/Export - v0.3.1 - First version!
Google client products use a system called RLZto perform cohort tagging to manage promotion analysis. This is accomplished byhaving the product record certain events in its life cycle, such asinstallation, first Google search performed, home page set to Google, and so on,and then forwarding that information to Google.
An extension could record events for different products or for access points itdoes not own. This could result in incorrect assessment of partnershipdistribution. This problem could be mitigated by restricting the products and/oraccess points made visible through this API. For example, a chrome extensionshould not affect Google Desktop or Chrome Omnibox access points.
DoS attacks on Google are not possible since the underlying RLZ code preventsmore than one financial ping per product per 24 hour period for all RLZ users onthe same machine, not only chrome extensions.
An array of two-letter access point names used within the extension. Each name should be unique within the RLZ access point name space. Refer to the function GetAccessPointName() in the RLZ code.
DescriptionThe chrome.declarativeNetRequest API is used to block or modify network requests by specifying declarative rules. This lets extensions modify network requests without intercepting them and viewing their content, thus providing more privacy.
In addition to the permissions described previously, certain types of rulesets, static rulesets specifically, require declaring the "declarative_net_request" manifest key, which should be a dictionary with a single key called "rule_resources". This key is an array containing dictionaries of type Ruleset, as shown in the following. (Note that the name 'Ruleset' does not appear in the manifest's JSON since it is merely an array.) Static rulesets are explained later in this document.
There is only one each of these ruleset types. An extension can add or remove rules to them dynamically by calling updateDynamicRules() and updateSessionRules(), provided the rule limits aren't exceeded. For information on rule limits, see Rule limits. You can see an example of this under code examples.
Unlike dynamic and session rules, static rules are packaged, installed, and updated when an extension is installed or upgraded. They're stored in rule files in JSON format, which are indicated to the extension using the "declarative_net_request" and "rule_resources" keys as described above, as well as one or more Ruleset dictionaries. A Ruleset dictionary contains a path to the rule file, an ID for the ruleset contained in the file, and whether the ruleset is enabled or disabled. The last two are important when you enable or disable a ruleset programmatically.
The set of enabled static rules and rulesets is persisted across browser sessions. Neither are persisted across extension updates, meaning that only rules you chose to leave in your rule files are available after an update.
For performance reasons there are also limits to the number of rules and rulesets that may be enabled at one time. Call getAvailableStaticRuleCount() to check the number of additional rules that may be enabled. For information on rule limits, see Rule limits.
To enable or disable static rules, call updateStaticRules(). This method takes an UpdateStaticRulesOptions object, which contains arrays of IDs of rules to enable or disable. The IDs are defined using the "id" key of the Ruleset dictionary.
To enable or disable static rulesets, call updateEnabledRulesets(). This method takes an UpdateRulesetOptions object, which contains arrays of IDs of rulesets to enable or disable. The IDs are defined using the "id" key of the Ruleset dictionary.
Regardless of type, a rule starts with four fields as shown in the following. While the "id" and "priority" keys take a number, the "action" and "condition" keys may provide several blocking and redirecting conditions. The following rule blocks all script requests originating from "foo.com" to any URL with "abc" as a substring.
Rules are triggered by requests sent from web pages. If multiple rules match a particular request, then the rules must be prioritized. This section explains how they're prioritized. Prioritization happens in two stages.
If the action type is not block or redirect, any matching modifyHeaders rules are evaluated. Be aware that if there are any rules with a developer-defined priority lower than the priority specified for allow and allowAllRequests, such rules are ignored.
Static rules are those specified in rule files declared in the manifest file. An extension can specify up to 100 static rulesets as part of the "rule_resources" manifest key, but only 50 of these rulesets can be enabled at a time. The latter is called the MAX_NUMBER_OF_ENABLED_STATIC_RULESETS. Collectively, those rulesets are guaranteed at least 30,000 rules. This is called the GUARANTEED_MINIMUM_STATIC_RULES.
The number of rules available after that depends on how many rules are enabled by all the extensions installed on a user's browser. You can find this number at runtime by calling getAvailableStaticRuleCount(). You can see an example of this under code examples.
Starting in Chrome 121, there is a larger limit of 30,000 rules available for safe dynamic rules,exposed as the MAX_NUMBER_OF_DYNAMIC_RULES. Anyunsafe rules added within the limit of 5000 will also count towards this limit.
Additionally, each rule must be less than 2KB once compiled. This roughly correlates with the complexity of the rule. If you try to load a rule that exceeds this limit, you will see a warning like the following and the rule will be ignored.
A declarativeNetRequest only applies to requests that reach the network stack. This includes responses from the HTTP cache, but may not include responses that go through a service worker's onfetch handler. declarativeNetRequest won't affect responses generated by the service worker or retrieved from CacheStorage, but it will affect calls to fetch() made in a service worker.
A declarativeNetRequest rule cannot redirect from a public resource request to a resource that is not web accessible. Doing so triggers an error. This is true even if the specified web accessible resource is owned by the redirecting extension. To declare resources for declarativeNetRequest, use the manifest's "web_accessible_resources" array.
The following example shows how to enable and disable rulesets while considering the number of available and the maximum number of enabled static rulesets. You would do this when the number of static rules you need exceeds the number allowed. For this to work, some of your rulesets should be installed with some of your rulesets disabled (setting "Enabled" to false within the manifest file).
The following example shows how to redirect a request from example.com to a page within the extension itself. The extension path /a.jpg resolves to chrome-extension://EXTENSION_ID/a.jpg, where EXTENSION_ID is the ID of your extension. For this to work the manifest should declare /a.jpg as a web accessible resource.
The following uses the "transform" key to redirect to a subdomain of example.com. It uses a domain name anchor ("") to intercept requests with any scheme from example.com. The "scheme" key in "transform" specifies that redirects to the subdomain will always use "https".
The following example uses regular expressions to redirect from to In the "regexFilter" key, notice how periods are escaped and that the capturing group selects either "abc" or "def". The "regexSubstitution" key specifies the first returned match of the regular expression using "\1". In this case, "abc" is captured from the redirected URL and placed in the substitution.
Types DomainType This describes whether the request is first or third party to the frame in which it originated. A request is said to be first party if it has the same domain (eTLD+1) as the frame in which the request originated.
Substitution pattern for rules which specify a regexFilter. The first match of regexFilter within the url will be replaced with this pattern. Within regexSubstitution, backslash-escaped digits (\1 to \9) can be used to insert the corresponding capture groups. \0 refers to the entire matching text.
The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.
The rule will not match network requests when the domains matches one from the list of excludedRequestDomains. If the list is empty or omitted, no domains are excluded. This takes precedence over requestDomains.
List of resource types which the rule won't match. Only one of resourceTypes and excludedResourceTypes should be specified. If neither of them is specified, all resource types except "main_frame" are blocked.
Note: The regexFilter must be composed of only ASCII characters. This is matched against a url where the host is encoded in the punycode format (in case of internationalized domains) and any other non-ascii characters are url encoded in utf-8.
The rule will only match network requests when the domain matches one from the list of requestDomains. If the list is omitted, the rule is applied to requests from all domains. An empty list is not allowed.
Time interval within which MAX_GETMATCHEDRULES_CALLS_PER_INTERVAL getMatchedRules calls can be made, specified in minutes. Additional calls will fail immediately and set runtime.lastError. Note: getMatchedRules calls associated with a user gesture are exempt from the quota.
Promises are supported in Manifest V3 and later, but callbacks are provided for backward compatibility. You cannot use both on the same function call. The promise resolves with the same type that is passed to the callback.
d3342ee215