Comments (12)
Thanks @superhawk610, I managed to get around this issue by making the error invisible by modifying the channel.css file. :)
from multicast.
from multicast.
One more thing to try is the X-Frame-Options
header for your dashboard page, make sure it's set to the following:
X-Frame-Options: ALLOW-FROM http://{multicast-ip:port}
Can you try loading the device's display on your desktop browser (click Preview on the Device entry from the Devices page) and verify that it loads correctly there? If it doesn't, what error messages do you get in the console?
Additionally, I've had some issues in the past with the *
not being sufficient for the control origin header, so you can also try
Access-Control-Allow-Origin: http://{multicast-ip:port}
Make sure not to include a slash at the end, so it should look something like this
Access-Control-Allow-Origin: http://192.168.10.10:3944
Finally, just to make sure it's actually a CORS issue and not something else entirely, can you verify that you are able to create a channel with another URL (such as one of the two built-in channels) and display it correctly on a connected device?
from multicast.
I have the same issue with my dashboards. The channel loads correctly, but that annoying banner appears over the top. Any way to simple disable the error reporting?
from multicast.
@superhawk610 Thanks for the very quick reply!
I've tried setting the IP specifically in both Access-Control-Allow-Origin
and X-Frame-Options
and it doesn't seem to have made any difference, unfortunately.
Here's my local Firefox dev tools when previewing the device from Multicast:
And here's Chrome's inspector connected directly to the Chromecast:
It's interesting that it says the X-Frame-Options header is invalid, since I cross-checked it with MDN and it looks fine!
The Nyan built-in channel displays on the TV and in my browser just fine with no error message.
In the meantime I've commented out the bit of code that displays the error, but obviously something is still fishy!
from multicast.
@jonty-comp looks like Chrome does not support the ALLOW-FROM syntax for X-Frame-Options, only DENY and SAMEORIGIN. Huh.
Does the page load correctly, it's just the warning message displaying incorrectly? I think my code for checking if an iframe is blocked due to CORS protection is faulty. Here's the relevant portion:
function checkFrame(frame) {
var html,
failed = false
try {
var doc = frame.contentDocument || frame.contentWindow.document
html = doc.body.innerHTML
} catch (e) {
failed = true
}
if (!html) failed = true
if (failed)
displayError('Frame loading blocked due to cross-origin prevention')
}
It attempts to fetch the document body of each iframe on the page, which, if successful, should prove that it loaded correctly. There should be a better way to do this, but as far as I can tell there is no built-in method of communicating with the browser to check if a request was blocked due to CORS or not. Any suggestions?
@plitewaikato until we can get a permanent fix, you can disable errors by making this change:
# app/lib/connection.js
addError: (device, message) => {
+ return
// you can pass a tag directly instead of a device
from multicast.
Yes, the page itself loads fine, and i've gotten around the problem for now by commenting out the check rather than the error display, but obviously it would be nice to find a proper solution.
From a quick googling it seems like document.onload
might work for checking if the iframe is loaded, or perhaps there's some way related to how you wanted to catch console errors from the chromecast back to the server.
from multicast.
The more I look around, the more it seems like there's no consistent way to accomplish this client-side. I think the correct solution is to have the server perform an OPTIONS request when saving the channel and throwing up a warning if it finds any problematic headers, such as X-Frame-Options or the like.
from multicast.
We are seeing the same issues and most dashboard are not loading correctly. If we use the multicast version of october 7th the issue is not present. Any ideas?
from multicast.
@bugtoo can you reply/PM me with more specifics about how they're not loading correctly? Quite a bit has changed since the 1.0 release last October. If you're just having an issue with the "Frame loading blocked" error message, you can disable error reporting until a permanent fix is released using this method.
from multicast.
I think the correct solution is to have the server perform an OPTIONS request when saving the channel and throwing up a warning if it finds any problematic headers, such as X-Frame-Options or the like.
I'll implement this in the next major release.
EDIT: Tracking this via #46.
from multicast.
This issue is being incorporated into the v3.0 release milestone.
from multicast.
Related Issues (20)
- Bring it back! Bring it back! :-)
- Could not connect to Mongo. HOT 8
- old cache appears HOT 1
- Clearing out Mongo HOT 2
- Chromecast is listed in the device page but the IP address of the host is my laptop
- Channel URL dissapears HOT 1
- Cleaner channel takeover for video HOT 2
- how to edit app/lib/connections.js HOT 2
- when updating message channel. TypeError: d.channel.URLS[0].match is not a function HOT 2
- Timing of content HOT 3
- Chromecast ultra problem HOT 7
- *URL* refused to connect. HOT 14
- Refeshing cached of images on chromecast or multicast HOT 2
- Receivers stopped working suddenly, reporting LAUNCH_ERROR HOT 1
- Background video stopped displaying - Black Screen HOT 10
- LAUNCH_ERROR after Chromecast Ultras self updated
- Running on https HOT 1
- Oops! We encountered an error. Network error: Failed to fetch
- Multicast video stream not working HOT 1
- not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multicast.