How to fix issues with unsecure http in browsers?

| | 1 min read

I had faced the issue with browser compatibility issues with the Safari browser and the Chrome browser to load the CSS styles due to unsecured http. This can be fixed by setting right protocol type.

Getting external fonts from Google APIs is a problem if the protocol is https so we set the protocol of the link same as that of the protocol that the site is currently using,

if($is_https) {
   $protocol = 'https';
 }
 else {
   $protocol = 'http';
 }
 
$variables['google_api_font_link'] = "<link href=" . $protocol . "://fonts.googleapis.com/css?family=Oswald:400,700|Satisfy|Lato|Convergence|Open+Sans:400,300,600,700,300italic,400italic,600italic,700italic' rel='stylesheet' type='text/css'>";

The above code can be added in the template.php and the issue with browser compatibility can be fixed.

Alternately, you can get help from Drupal experts who can provide a wide range of Drupal services to you. Drop us a line to get support.