Include "meta viewport" in DirectoryListing output to better support iPhone
|Reported by:||russryba||Owned by:|
|Component:||web||Keywords:||iPhone, iPod touch, webkit, viewport|
When using simple mktap web to browse directories, the pages do not format well on iPhone or iPod touch.
The cause of this problem is that iPhones expect a meta tag to be set to define the viewport dimensions of the device. This is part of the CSS specification that defines the size of the view window separate from the size of the page itself.
Adding a meta tag that defines the viewport appears to fix this problem. Tested locally with iPod Touch firmware 2.1.
Adding this line...
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, width=device-width">
...to twisted\web\woven\dirlist.py fixes this problem. This was at line 26 in my version, result source code is below.
class DirectoryLister(page.Page): template = ''' <html> <head> <title model="header"> </title> <meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, width=device-width" /> <style>
Searching for '<head>' I see several other places where adding this meta tag would be helpful. I know my source code is out of date so I will leave it to the developers to figure out where this should go in the latest code.
Change History (3)
comment:1 Changed 8 years ago by exarkun
- Summary changed from Change default html headers to better support iPhone to Include "meta viewport" in DirectoryListing output to better support iPhone
comment:2 Changed 7 years ago by thijs
- Cc thijs added
- Resolution set to wontfix
- Status changed from new to closed