question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loading TinyMCE over HTTPS, yet CSS files are loaded over HTTP and Chrome stops it

See original GitHub issue

I’ve downloaded a “custom” zip of tinymce, and un-zipped it in a subdirectory of my server. I do not use the TinyMCE CDN, because I’ll be integrating this into an app that manages cross-domain issues. The hosting page, and the tinymce script, are served over HTTPS. However, after doing that, the script turns around and attempts to load two CSS files over HTTP, which Chrome blocks, which causes the load to fail and the editor to not appear.

I’ve tried configuring for https, but it doesn’t seem to “take.”

Here’s how I initialize it:

    var baseurl = document.location.protocol + "//" + document.location.host + "/(removed)/tinymce";
    tinymce.init({
        'selector': '#stencils_temp',
        width: 960,
        height: 800,
        relative_urls: true,
        remove_script_host: true,
        document_base_url: baseurl,
        protocol: 'https',
        plugins: 'advlist autoresize charmap colorpicker emoticons hr link nonbreaking paste tabfocus textcolor visualchars anchor code contextmenu image insertdatetime lists noneditable preview searchreplace table wordcount autolink directionality fullscreen imagetools media pagebreak print spellchecker template visualblocks'
    });

(The same problem happens with only the selector: configuration)

Here are the errors I get:

(index):1 Mixed Content: The page at ‘https://(removed)/stencils/’ was loaded over HTTPS, but requested an insecure stylesheet ‘http://(removed)/tinymce/skins/lightgray/skin.min.css’. This request has been blocked; the content must be served over HTTPS.

(index):1 Mixed Content: The page at ‘https://(removed)/stencils/’ was loaded over HTTPS, but requested an insecure stylesheet ‘http://(removed)/tinymce/skins/lightgray/content.min.css’. This request has been blocked; the content must be served over HTTPS.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jwattecommented, Oct 5, 2016

The problem for me was that an unrelated error caused a redirect to an insecure version of the page.

0reactions
merwokcommented, Apr 1, 2019

FWIW, protocol-relative URLs are valid (e.g. script src="//cdn.example.com/file.js"), but it’s simpler to always have https URLs given that both http and https pages can load https resources.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Most common plugin errors in TinyMCE and how to fix them
Ways to fix the most common plugin errors in TinyMCE and why those happen, including “TinyMCE failed to load plugin” error.
Read more >
How browser decides what to use: http or https (tinymce load ...
I have problem with tinymce 4.1.10. Icons are not shown in it, then i put it in page, that is loaded through https....
Read more >
How to Quickly Fix Mixed Content Warnings (HTTPS/SSL)
Below are some examples of what can happen if some of your content is still loading over HTTP instead. Mixed Content Warning Examples....
Read more >
tinyMCE reports "failed to load content.min.css" but file was there
2743.116 Safari/537.36 Edge/15.16193 Steps to reproduce: 1) the problem shows up in Firefox v.53, if I use Chrome everything works fine 2) I...
Read more >
Bug #1811284 “Equation editor will not load in HTTPS”
Opening the TinyMCE equation editor in 18.10.0 does not display. ... was loaded over HTTPS, but requested an insecure stylesheet 'http://.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found