-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Several Widgets Not Rendered (?) #17
Comments
I have the same problem. Does anyone have any suggestions? |
I've just tried to reproduce this issue for the IFrame, as it is provided with the default installation. Here's my settings:
I see an empty dashboard, but in the console I can see that there was an error trying to embed Google, since it prevents it via X-Frame-Options header. But replacing https://google.co.nz by another web site, such as https://www.usp.br, it works with no issues. Maybe you have the same issue with that X-Frame-Option header? You can inspect the DOM in the browser developer tools too, to see if there is an iframe there, or also see if there is something in the JavaScript console. Hope that helps, |
Hi @kinow, Thanks for your inputs. Since my post I performed further searches as well and actually X-Frame-Options header appears as very possible root cause (I will test with https://www.usp.br too). However I cannot explain why it seems to work fine for many people I've seen using it (blogs, tutorials, etc...) and with NodeJS fork as well. Don't know if any workaround or even solution is available. Thanks again, |
Not a problem @thbg . Let us know if that works for you. FWIW, I was using the NodeJS fork some months ago in a company, but they had a project to migrate to this project, as the NodeJS is not being maintained anymore. |
Hi, Some news... By using Firefox Ignore X-Frame-Options add-on I've been able to display a simple google maps page into an Iframe : However no more luck with dashing-trafficmap. Still blank page... Tom |
This one https://github.com/wolfspyre/dashing-trafficmap Tom? Have you contacted the author to check if he's aware of any recent incompatible changes? Anything in the JS console, or Network console in your browser? |
Yes this is the widget I'm testing. Initially I wanted to open issue against it until I discovered that problem was more generic (iframe...). And it seems there is no issue menu like here on his page (?). However I asked question against dashing-map the original project from which dashing-trafficmap has been forked (and which has of course same problem for me). No answer yet. No obvious message in console (from my knowledge) except :
Despite this I'm still progressing on pure iframe workaround (ie without above widgets mentioned). I'm now able to display traffic map. Now trying to remove the top boring search box : Tom |
I'll have some spare time this weekend, and can try to reproduce the issue and see if I can help. Do you have some code snippets (from job/dashboard/widget/etc) that you could share and would help me reproduce it locally in a fresh installation? |
I uploaded a simple dashboard containing 4 parts :
Of course for 2, 3 and 4 parts you need to install trafficmap widget and grab a free Google Maps API key. Part 3 would be more or less interesting as workaround if I could manage some options (hide search box, prevent dragging and zooming...). I also discovered that subject has been more or less discussed in original project : Shopify/dashing#467 Still unable to explain why it works/ed for many people... Moreover there are tons of tutorials on the web explainng how to easily embed google maps into iframe. Despite review of widget code which is quite simple I cannot understand why it fails. I'm reviewing https://developers.google.com/maps/documentation/javascript/examples/layer-traffic as well... Don't mess up your whole week-end or spare time on that. It's not so important ;-) Tom |
Hi Tom, Thanks a ton for uploading an example dashboard, and for instructions on how to reproduce. I'll take a look next time I have some spare time for sure :-) if anyone else feels like trying to reproducing, feel free to chime in as well. On "Still unable to explain why it works/ed for many people... ", I think I have an explanation, but wouldn't be able to confirm whether it's 100% correct. My understanding is that some tutorials were written before browsers started enforcing the behavior. Or by people who were using an older version of browsers. Here you can have a look at the list of browser support. Mixed content warninigs, forms without HTTPS, and a few other changes that affect users have been more widely disseminated after some recent attacks, so that's my guess ;-) HTH, |
Oh, and of course, maybe the web sites were not sending that header before... |
Waiting for Jenkins to restart and install plug-ins, so had 15 minutes to play with it.
Yup, as long as they don't change the X-Frame-Options.... there are sites that always allow iframes, such as billing/login services as Zuora/Stormpath that have specific URL's, more permissive sites like USP or Duckduckgo, and normally some traffic/weather/news also have URL's that allow. But all it takes is a sysadmin reviewing server roles to get a URL blocked... use with care iframes
Yup, or keep the add-on always enabled :-)
There's something wrong with the trafficmap widget indeed. Adding Google Maps to the top of the script, with an API key, also synchronously, will definitely creates a Google Maps object in the DOM. But as the widget removes the CSS widget class, the component is not rendered correctly. The wolfspyre/dashing-trafficmap#1 is not necessary. But you do have to remove this line locally, or the component is never rendered. Attached screen shot. @thbg I believe this issue can be closed. WDYT? |
Hi Bruno, Thanks a lot for this. However I'm unsure about the solution.
Thx |
Regarding the X-Frame-Options, we do not have much to do in order to get that working. The IFrame widget has this limitation, that it will simply add an iframe tag. The browser will handle the rest, and most browsers will respect the X-Frame-Options. If you have a dashboard that needs to add an iframe to a server that is sending the X-Frame-Options, you will have to either have the add-on enabled, or create another solution (i.e. some sort of reverse proxy, that strips off that header...). As for
You are correct. It is not included. Mentioned just in case you applied it locally. I tried it as that was the only pull request, and the reporter said something about not seeing the widget. There is not really a solution for the trafficmap issue you have. This seems to be an issue in the widget, that would have to be fixed there. If you ping me in a pull request/issue to trafficmap repository, I'd be happy to chime in, try to reproduce issues, and comment. But there's nothing we can do here in Smashing :) |
Before I got the widget working, I kept seeing JS errors in the browser console. In case it's still not working for you, check that you have the <script> tag loading Google Maps. That it is not using async/defer attributes. And that you don't get any errors in the JS console that could indicate Google Maps is not being loaded. When you have the dashboard open, you can open the JS console in your browser and type google.maps. It should print the current google.maps object, unless it was not loaded. We are digressing from smashing on this too, as it seems to be related uniquely to the trafficmap widget. So it's better to move the conversation to the widget repository or somewhere else. |
Still no luck for me :-( |
Finally got the same result as you. |
Looks like. The UI didn't change much, nor in Dashing (old project) nor after the fork as Smashing. So I suspect that widget worked some long time ago, but probably Google Maps changed its API, and maybe the layout too. When you use a Google URL, normally they prevent you from adding it as iframes in other web sites. Except, when you have a valid API key. In this case you won't get the X-Frame-Options, as you are using the API. However, the number of calls per month is restricted, and you may have to buy a pro licence. |
Agree. Thanks. |
Finally I managed to get a very close to widget and acceptable (for me) solution ! 1. Create traffic map
2. Make file accessible 3. Create a dashboard with iframe widget calling local HTML file
4. Refresh This seems working with Firefox add-on disabled... The only drawback I found up to now is that zooming is still enabled despite values in HTML/Javascript. Hope this helps ! |
Hi! I've managed to get it working on dashing the way you explained. How can we do the job refresh? |
Hi, |
ok. Thanks @thomas-gt ! |
@thomas-gt, Many thanks for the workaround!! |
thanks @thomas-gt |
Hello,
After fresh install I'm unable to get display for a few widgets. Among those tested :
For them I do not get anything on screen, just background.
On the other hand all widgets from dashboards examples (sample and sampletv) are working fine...
I searched during hours and I tested many things without result. Initially I was thinking that Google Maps API calls were the culprits but I finally discovered that IFrame has same issue.
The only success I had was with a NodeJS fork of Dashing which allowed me to get a map displayed, but I'd like to use the Ruby version.
I can see some demos on the web so I guess it should work.
Does anyone has same issue ?
Any clue on how to fix this ?
I'm using :
and :
Thanks
Tom
The text was updated successfully, but these errors were encountered: