Author Topic: wxbuoys.php error when links are clicked  (Read 549 times)

0 Members and 1 Guest are viewing this topic.

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4108
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
wxbuoys.php error when links are clicked
« on: June 17, 2018, 02:21:43 PM »
Although this used to work fine, now I am getting an error in the embedded iframe as follows when I try to click one of the buoy links.

Quote
Blocked by Content Security Policy

This page has a content security policy that prevents it from being loaded in this way.

IceDragon prevented this page from loading in this way because the page has a content security policy that disallows it.

I tried the IE/Edge browser and I get a similar message. My older Firefox on the Linux box gives a blank white iframed page.

Yet, when I tried some other buoy pages from other WxForum members, theirs seem to load fine. (though they look a bit different and open a new tab, not an iframe)

I even located the buoy files in the root directory instead of /buoy/ like I had it, to no avail. I used the latest from saratoga (was newer than what I was using) and it didn't change this behavior.

Here is the page in question: http://rogerscityweather.com/wxbuoys.php

Thanks for any help on this. Is there a newer, differently structured buoy php file? I checked for updates and only found this: https://saratoga-weather.org/scripts-buoy.php

Greg H.




« Last Edit: June 17, 2018, 03:12:36 PM by miraculon »


Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: wxbuoys.php error when links are clicked
« Reply #1 on: June 17, 2018, 03:05:24 PM »
Although this used to work fine, now I am getting an error in the embedded iframe as follows when I try to click one of the buoy links.

Quote
Blocked by Content Security Policy

This page has a content security policy that prevents it from being loaded in this way.

IceDragon prevented this page from loading in this way because the page has a content security policy that disallows it.

I tried the IE/Edge browser and I get a similar message. My older Firefox on the Linux box gives a blank white iframed page.

Yet, when I tried some other buoy pages from other WxForum members, theirs seem to load fine. (though they look a bit different and open a new tab, not an iframe)

I even located the buoy files in the root directory instead of /buoy/ like I had it, to no avail. I used the latest from saratoga (was newer than what I was using) and it didn't change this behavior.

Here is the page in question: http://rogerscityweather.com/wxbuoys.php

Thanks for any help on this. Is there a newer, differently structured buoy php file? I checked for updates and only found this: http://

Greg H.
Your version is up-to-date and works exactly the same as the other ones you see around.
Just check it as  a stand-alone page: http://rogerscityweather.com/buoy/buoy-data.php
Clicking a buoy will display the http://www.ndbc.noaa.gov/ page for that buoy  ON TOP of your page.

Buy putting it in an iframe  the http://www.ndbc.noaa.gov/ should also be displayed ON TOP of your page, but that would mean in an iFrame.  And ndbc.noaa.gov does not like that, as do a lot of others nowadays.

You should make a normal page without an iframe and then it should work.
or you should modify buoy-data.php V1.18 24-Feb-2015 and add at two places (for map and table) a target="_blank" to the href, at lines 467 and 856
Wim
« Last Edit: June 17, 2018, 03:13:13 PM by wvdkuil »

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4108
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: wxbuoys.php error when links are clicked
« Reply #2 on: June 17, 2018, 03:13:42 PM »
OK, thanks. I'll try reworking the page soon to get rid of the iframe.

Greg H.


Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4108
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: wxbuoys.php error when links are clicked
« Reply #3 on: June 18, 2018, 10:35:52 AM »
After a lot of fiddling around, I finally settled on changing to a php include, commenting out the iframe:

Code: [Select]
<!--<iframe src="http://rogerscityweather.com/buoy/buoy-data.php?show=normal" width="660" height="750"></iframe>-->
<?php include("http://rogerscityweather.com/buoy/buoy-data.php");?>

Although it finds the buoy-data.php inside the /buoy sub-directory, it was missing the arrows.

I fiddled with this, trying to get it to recognize the /buoy/arrows directory:

Code: [Select]
  $windArrowDir = './arrows/'; // set to directory with wind arrows, or
//                        set to '' if wind arrows are not wanted
//                        the program will test to see if images are
//                        available, and set it to '' if no images are
//                        found in the directory specified.
//                        // used for rotating legend display :

to no avail. There must be some reason it is trying to go to the root html directory instead of looking in the /buoy subdirectory, but I am going to stop fighting it for now. I copied my arrows directory to the root and they started showing up. It seems to be working with my cobbled mess.  ](*,)

In a previous panic, placing the huronbuoys2.gif file in the root directory also, where it was originally in the /buoy sub-directory. To try to clean things up, I deleted the root copy leaving the one in /buoy. That broke the page. I recopied it back to the html root directory and it started working again. Maybe this is related to the arrows directory issue.

Even a blind squirrel finds a nut every once in a while...


Greg H.




Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

 

anything