Jump to content

MIME type mismatch (“text/html”) (X-Content-Type-Options: nosniff). Adding code and having trouble/issue/problem with Squarespace visualization in the browser.

Recommended Posts

Hello everyone!

IF ANYONE WANTS SOME CODE THAT APPEARS ON MY SITE JUST LET ME KNOW


I had an issue recently about the visualization of the galleries.
It was everything perfect since the middle of this year wit the page but suddenly there are no images on the gallery.

Well first of all i'm not a big knower of coding, just exploring that and making my best.

On the console it is showing this error

The resource “https://makeamove.art/en/style.css” was blocked due to a MIME type mismatch (“text/html”) (X-Content-Type-Options: nosniff).

This code is on the head, maybe here is the problem, i'm not an expert on coding. I add all the code at the end of the page


<html>
<head>
<title>CSS Navigation</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>

So the path that the browser is looking for is not the same as it should be i guess.

On the browser

https://makeamove.art/en/audiovisual-home

The /en/ is the way i founded to make my page bilingual in a rudimentary mode...

I was looking into the net and no way to find a solution, but more people had this issues in different environments. 
It is something about the browsers policies?

While all the code i added on the web (almost everything...) is working, now it is not working the stencil galleries from Squarespace... 

I'm getting a little bit desesperated. 

If someone can helps on that it will be great 🙂

I added a picture where you can see the images are in the gallery but with not preview on the editing page, and the other picture in the safe mode where you can see the images of the gallery but not any code of the page...

I will add my little chaos of code at the end of the page so it can be better understanded...

Thanks!

FOR ALL PAGES:

/* HEADER */

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
 <script>
 $(window).load(function() {
    show();
 });
 
 function show() {
     $('.loader').delay(1000).hide();
     $('body').fadeIn();
 };
 
 setTimeout(show, 3000);
 </script>
 
 <style>
 .loader { position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 9999; background: url('https://static1.squarespace.com/static/61f139f6ffe2866ba1fa8017/t/61f35e7f669542504d9dc4b9/1643339391776/makemove_glitch_yeah.gif') 50% 50% no-repeat rgb(249,249,249);  }
 </style>

<html>
<head>
<title>CSS Navigation</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
  
<body>
<div id="abc">
    <nav>
        <ul>
            <li><a href="#"></a></li>
            <li><a href="#"></a></li>
            <li><a href="#"></a></li>
            <li><a href="#"></a></li>
            <li><a href="#"></a></li>
        </ul>
    </nav>
</div>
</body>
</html>

 

/* FOOTER */

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
  $(function() { 
  /* SETUP MULTI-LANGUAGE */
  var defaultLanguage = 'en';
  var lang = location.pathname.split("/")[1];
  var defaultClass = 'lang-'+defaultLanguage+'';
  var itemParent = "nav [class*='collection'],nav [class*='folder'],nav [class*='index'],nav [class*='group']";
  if (lang == "" || lang.length > 2 ){
    var lang = defaultLanguage;
  }

  /* ADD LANGUAGE CLASSES */
  $('a[href="/"]').addClass('lang-'+defaultLanguage+'').parents(itemParent).addClass('lang-'+defaultLanguage+'');
  $('nav a:link:not([href^="http://"]):not([href^="https://"])').each(function () {
    var langType = $(this).attr('href').split("/")[1];
    var multiLanguageClass = 'multilanguage lang-' + langType + '';
    if (undefined !== langType && langType.length <= 2) 
      $(this).addClass(multiLanguageClass).parents(itemParent).addClass(multiLanguageClass);
  });
  $('nav button').each(function () {
    var langTypeFolder = $(this).attr('data-controller-folder-toggle').split("/")[0];
    var multiLanguageClass = 'multilanguage lang-' + langTypeFolder + '';
    if (undefined !== langTypeFolder && langTypeFolder.length <= 2) 
      $(this).addClass(multiLanguageClass);
  });

  /* HOMEPAGE-LOGO LINKS TO PROPER LANGUAGE HOMEPAGE */
  if (lang == "es") {
    $('a[href="/"]').attr("href", "/es/audiovisual-inicio/");
  }

  /* ADD EXCLUSION NAV ITEMS */
  $('.exclude-me,.exclude-me a').addClass('exclude');
  $('.sqs-svg-icon--list a,.SocialLinks-link').addClass('exclude');

  /* REMOVE OTHER LANGUAGES AND KEEP EXCLUDED ITEMS */
  $('.multilanguage:not(".lang-'+lang+',.exclude")').remove();
});
</script>

<script>
/*setup language switcher*/
$('body').prepend('<div class="language"><a href="/es/audiovisual-inicio/" class="lang-es">Esp</a> | <a href="/en/audiovisual-home" class="lang-en">Eng</a></div>');
</script>

<div class="loader">
  
</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/parallax.js/1.4.2/parallax.min.js"></script>

<script> 
  $('.has-background:not(:has(.sqs-video-background))').each(function() {
    var findImage = $(this).find('.section-background img');
    var imgUrl = findImage.data('src') + '?format=2500w';
    var dimensions = findImage.data('image-dimensions');
    var imgWidth = dimensions.substr(0, dimensions.indexOf('x'));
    var imgHeight = dimensions.substr(dimensions.indexOf('x') + 1);
    $(this).parallax({
        bleed: 0,
        imageSrc: imgUrl,
        naturalWidth: imgWidth,
        naturalHeight: imgHeight,
        speed: .5,
    })
});
document.getElementsByTagName("body")[0].onresize = function() {
    setTimeout(function() {
        jQuery(window).trigger('resize').trigger('scroll')
    }, 100)
}; 
</script>

<style>.has-background{background-color:transparent!important}.has-background .section-background{background-color:transparent!important}.has-background .section-background img{visibility:hidden!important}.has-background.background-width--inset{margin:4vw;padding:0!important}.has-background.background-width--inset:not(.content-collection):not(.gallery-section) .section-background{top:0!important;right:0!important;bottom:0!important;left:0!important}</style

 

FOR EACH PAGE:

 

<style>
  #header, footer {
  display: none!important;}
</style>

So the Squarespace header is not showed

Captura de pantalla 2022-10-26 a las 15.29.08.png

72f8d5e6-dd76-4ce2-827b-5e8d066d3446.jpg.png

Link to comment
  • Replies 1
  • Views 414
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.