Topic: basic page error

I made one change to an existing Basic Page, saved and uploaded and now I am getting errors in any browser I view it in. Even when I go back to the previous source code that was on the page, errors still show. Please view https://djphoto.com/video/ to view what I am referring to and let me know if you have a suggestion how to get this working again. Thank you!

Re: basic page error

I notice your YouTube embedding code looks like:

<iframe allowfullscreen="" frameborder="0" height="236" sandbox="" src="https://www.youtube.com/embed/xxxxxxxxxxx?rel=0&amp;fs=0" width="420"></iframe>

Having run a quick test, it looks like the video will show up in the page if you remove the sandbox="" attribute.

(Also, your second YouTube embed src attribute has a space immediately after the opening double-quote. I don't think this is actually causing a problem but it shouldn't really be there.)

I'll keep my fingers crossed that removing the sandbox="" attributes resolves your problem.

Just in case this does not work (although it does work in my own test), here is the current YouTube embed code (taken from a video on the YouTube site a couple of minutes ago). You could try using the same format and attributes as this:

<iframe width="560" height="315" src="https://www.youtube.com/embed/xxxxxxxxxxx?si=xxxxxxxxxxxxxxxx" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

(I think the ?si=xxxxxxxxxxxxxxxx query string is a tracking id which can probably be omitted.)

Re: basic page error

Thanks, I appreciate the quick reply!

It was while I was making a transition over to using Vimeo from YouTube that this started. I followed your advice to remove the sandbox="" attribute and it is once again working (both with Vimeo and YouTube).

One strange thing though, each time I save the page in Showkase it automatically adds the sandbox attribute on its own.

Re: basic page error

I'm glad that helped.

One strange thing though, each time I save the page in Showkase it automatically adds the sandbox attribute on its own.

That's weird. I've just searched through every Showkase source file and the term 'sandbox' was not found.

Also, during my original test, I did not manually remove the 'sandbox' attribute from the HTML file in an external text editor, I used the built-in Showkase page editor and saved the page normally and the 'sandbox' attribute did not reappear (even after a re-save with no 'sandbox' attribute there).

The editor puts the attributes in alphabetical order and changes sandbox to sandbox="" (similar for all attributes without a value) but does not seem to actually add 'sandbox' if it's not already there... at least in my own tests.

Re: basic page error

Yeah, I've found it is happening after every save of that page.

I'm using your unofficial update patch. Don't think that would make a difference (and I'm guessing you're running it also), but thought it's worth mentioning.

The good thing is it's up and running now after you caught the "sand box" in the code. Thank you!

Re: basic page error

I'm using your unofficial update patch.

Thank you for the additional information. I think that might be the root of the problem.
My tests were done on a stock Showkase v1.7.6 installation (without the patch in place).
My patch updates CKEditor (the Showkase editor) and I've done some digging and found the following in the CKEditor changelog:

Starting from version 4.21, the Iframe Dialog plugin applies the `sandbox` attribute by default, which restricts JavaScript code execution in the iframe element. To change this behavior, configure the `config.iframe_attributes` option.

That's all well and good, in theory, but, as we've discovered, this prevents Vimeo and YouTube videos from displaying.
Here's something to try. Open the showkase/admin/settings/ckeditorconfig.js file (from your patched installation) and add the following to the foot of the file (before the closing };).

config.iframe_attributes = {
    sandbox: 'allow-scripts allow-same-origin'
}

This should add the sandbox="allow-scripts allow-same-origin" attribute to your iframes (instead of sandbox="") allowing your videos to display.
Hopefully this'll fix the problem.

Re: basic page error

I tried adding that but without success so went back to the original unofficial patch. Please see these last few lines and let me know if I had placed it correctly.

  ];
config.iframe_attributes = {
    sandbox: 'allow-scripts allow-same-origin'
}
};

Re: basic page error

Code and code placement looks fine. it worked for me when I tested it (before posting).
Maybe server-side caching is still serving up the older version of your file (before modification)? Try going directly to your showkase/admin/settings/ckeditorconfig.js file in a browser, hit Ctrl+F5, make sure that you see the new code at the bottom of the file and then try again. I'll keep my fingers crossed.