CMUBigLab / webanywhere

Accessible Technology Anywhere
http://webanywhere.cs.washington.edu/beta/
Other
17 stars 7 forks source link

Meta tag http-equiv="refresh" breaks content frame #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Navigate WA to a page with a <meta http-equiv="refresh"
content="0;someRelativeURL.html" />
2. Note that WebAnywhere tries to go to that page on the proxy, it doesn't
attempt to load that URI relative to the proxy.

What is the expected output? What do you see instead?
   It should proxy that page.

Please use labels and text to provide additional information.

Original issue reported on code.google.com by kril...@gmail.com on 24 May 2010 at 8:58

GoogleCodeExporter commented 9 years ago
Note that any sort of meta-refresh breaks the content frame, since none of them 
are
proxied.

Original comment by kril...@gmail.com on 24 May 2010 at 9:04

GoogleCodeExporter commented 9 years ago
Mostly fixable by noting that the HTML DTD only allows content="" in meta tags, 
so it should be safe to 
replace them in general.

This will at least proxify the URL so that it refreshes in a way that 
WebAnywhere can handle.

// Automatic refreshes are also bad for accessibility.
//$_response_body = preg_replace('#http-equiv="Refresh"#', 
'http-equiv="Refresh2"', $_response_body);
  $_response_body = preg_replace_callback('#content="(?:\d+;)?(.*)"#', function ($match) {
      global $_script_url;
      global $_config;
      return 'content="0;'. $_script_url . '?' . $_config['url_var_name'] . '=' . encode_url($match[1]) . '"';
  }, $_response_body);

Original comment by kril...@gmail.com on 24 May 2010 at 10:02

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r296.

Original comment by kril...@gmail.com on 28 May 2010 at 9:53