Author Topic: WeatherGround denying iframe  (Read 209 times)

0 Members and 1 Guest are viewing this topic.

Offline ctccbc

  • Senior Contributor
  • ****
  • Posts: 250
  • Acurite 01035, Weather Display
    • Chris Collins Morehead City, NC Weather
WeatherGround denying iframe
« on: November 21, 2019, 10:47:51 AM »
I posted this in the Weather Underground topic, but maybe it is better here. I have an Acurite Atlas and post data to Weather Underground. For my website, I have used an iframe for the past year or so to show the current conditions from Weather Underground. In the past week or so, they seem to have blocked use of iframe. I was able to write several php scripts to grab data from the old Weather Underground table.

Anyone see this with WU blocking iframe use?

Thanks
Chris
moreheadcityweather.com

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1485
    • My PWS at Leuven Belgium Europe
Re: WeatherGround denying iframe
« Reply #1 on: November 21, 2019, 10:58:24 AM »
I posted this in the Weather Underground topic, but maybe it is better here. I have an Acurite Atlas and post data to Weather Underground. For my website, I have used an iframe for the past year or so to show the current conditions from Weather Underground. In the past week or so, they seem to have blocked use of iframe. I was able to write several php scripts to grab data from the old Weather Underground table.

Anyone see this with WU blocking iframe use?

Thanks
Chris
moreheadcityweather.com
Yes, so my visitors can not see my WU-data anymore inside my site.
I will remove that page,

Wim
Support for Leuven-Template & Scripts  at this forum
Support for the PWS_Dashboard (HWS-template) for WD a.o.  http://pwsdashboard.com/
Script sponsors https://support.leuven-template.eu/userlistScripts.php
Template sponsors https://support.leuven-template.eu/userlist.php

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7518
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: WeatherGround denying iframe
« Reply #2 on: November 21, 2019, 12:36:24 PM »
The response headers from WU do include
Code: [Select]
x-frame-options: sameoriginAccording to this spec, that has the meaning of
Quote
sameorigin
    The page can only be displayed in a frame on the same origin as the page itself. The spec leaves it up to browser vendors to decide whether this option applies to the top level, the parent, or the whole chain, although it is argued that the option is not very useful unless all ancestors are also in the same origin (see bug 725490). Also see Browser compatibility for support details.

So using an iframe on your site for that page should be blocked by the browser.  A PHP script access wouldn't have an issue accessing the raw page (since it doesn't honor that header).
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP