\DevOwl\RealCookieBanner\presets\freeGoogleFontsPreset

Google Fonts cookie preset.

Summary

Methods
Properties
Constants
common()
managerNone()
managerGtm()
managerMtm()
getPluginConstantPrefix()
No public properties found
IDENTIFIER
VERSION
WEB_FONT_LOADER_ON_PAGE_LOAD
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

IDENTIFIER

IDENTIFIER =\DevOwl\RealCookieBanner\presets\PresetIdentifierMap::GOOGLE_FONTS

VERSION

VERSION =2

WEB_FONT_LOADER_ON_PAGE_LOAD

WEB_FONT_LOADER_ON_PAGE_LOAD ='<script>
(function () {
  // Web Font Loader compatibility (https://github.com/typekit/webfontloader)
  var modules = {
    typekit: "https://use.typekit.net",
    google: "https://fonts.googleapis.com/"
  };

  var load = function (config) {
    setTimeout(function () {
      var a = window.consentApi;

      // Only when blocker is active
      if (a) {
        // Iterate all modules and handle in a single `WebFont.load`
        Object.keys(modules).forEach(function (module) {
          var newConfigWithoutOtherModules = JSON.parse(
            JSON.stringify(config)
          );
          Object.keys(modules).forEach(function (toRemove) {
            if (toRemove !== module) {
              delete newConfigWithoutOtherModules[toRemove];
            }
          });

          if (newConfigWithoutOtherModules[module]) {
            a.unblock(modules[module]).then(function () {
              var originalLoad = window.WebFont.load;
              if (originalLoad !== load) {
                originalLoad(newConfigWithoutOtherModules);
              }
            });
          }
        });
      }
    }, 0);
  };

  if (!window.WebFont) {
    window.WebFont = {
      load: load
    };
  }
})();
</script>'

Web Font Loader compatibility.

Methods

common()

common(): array

Common preset options.

Returns

array

managerNone()

managerNone(): array|boolean

Get all manager-relevant options for no manager.

Returns

array|boolean

managerGtm()

managerGtm(): array|boolean

Get all manager-relevant options for Google Tag Manager.

Returns

array|boolean

managerMtm()

managerMtm(): array|boolean

Get all manager-relevant options for Matomo Tag Manager.

Returns

array|boolean

getPluginConstantPrefix()

getPluginConstantPrefix(): string

Get the prefix of this plugin so composer packages can dynamically build other constant values on it.

Returns

string