View bootstrap.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
usage_exit() { | |
echo "Usage: $0 [-u] [-c]" 1>&2 | |
echo " -u: Update packages" | |
echo " -c: Clean caches" | |
exit 1 | |
} | |
abort() { |
View viewport_injection.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remember to import WebKit at the top of the file | |
let source = "var meta = document.createElement('meta');" + | |
"meta.name = 'viewport';" + | |
"meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no';" + | |
"var head = document.getElementsByTagName('head')[0];" + | |
"head.appendChild(meta);" | |
let userContentController = WKUserContentController() | |
userContentController.addUserScript(script) |