Typekit preload function – missing 'as' value and crossorigin attributes

Hi,

A quick question – I’m using Typekit and the your Typekit plugin on a website that I’m currently developing, and on Chrome DevTools it says:

A preload for 'https://use.typekit.net/[TYPEKIT-ID].js' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.

The resource https://use.typekit.net/[TYPEKIT-ID].css was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.

How do I add the ‘as’ values and the crossorigin attributes to the script and CSS preload?

I manually added a on Head but Chrome is still showing the notice.

I hunted down the notice on Chrome DevTools and it was on the embed script on your plugin as shown below.

Thanks
Chris

<script>
      (function(d) {
        var config = {
          kitId         : '<?php echo $tco_typekit_kit_id; ?>',
          scriptTimeout : 3000,
          async         : true
        },
        h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s)
      })(document);
    </script>

Hello Chris,

Thanks for writing in!

Please be advised that if you are using the latest version of the theme, you no longer need to activate the Typekit extension. Simply go directly to the Font Manager and you should be able to find the Adobe Fonts (Typekit) section. To know more about the Font Manager in the theme, please check this out:

Hope this helps.

I didn’t know that the typekit plugin has been integrated into Cornerstone.

Thanks btw.

You’re welcome! :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.