Skip to content

Commit

Permalink
Set user agent
Browse files Browse the repository at this point in the history
* Add VC and set the user agent on the web view when loading
  • Loading branch information
Alan Westbrook committed Mar 17, 2015
1 parent 964d762 commit 59e7220
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Inbox/Inbox/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6751" systemVersion="14D87h" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7525" systemVersion="14D105g" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6751"/>
<plugIn identifier="com.apple.WebKitIBPlugin" version="6751"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7525"/>
<plugIn identifier="com.apple.WebKitIBPlugin" version="7525"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
Expand Down Expand Up @@ -671,14 +671,16 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="335" y="390" width="1035" height="728"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="777"/>
<view key="contentView" id="EiT-Mj-1SZ">
<rect key="frame" x="0.0" y="0.0" width="1035" height="728"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<webView translatesAutoresizingMaskIntoConstraints="NO" id="E8F-EZ-zrc">
<rect key="frame" x="0.0" y="0.0" width="1035" height="728"/>
<webPreferences key="preferences" defaultFontSize="12" defaultFixedFontSize="12"/>
<webPreferences key="preferences" defaultFontSize="12" defaultFixedFontSize="12">
<nil key="identifier"/>
</webPreferences>
</webView>
</subviews>
<constraints>
Expand All @@ -690,5 +692,11 @@
</view>
<point key="canvasLocation" x="533.5" y="518"/>
</window>
<viewController id="fq0-rl-ocb" customClass="InboxViewController" customModule="Inbox" customModuleProvider="target">
<connections>
<outlet property="view" destination="EiT-Mj-1SZ" id="RJC-mG-7RB"/>
<outlet property="webView" destination="E8F-EZ-zrc" id="6oe-Ao-hdf"/>
</connections>
</viewController>
</objects>
</document>
23 changes: 23 additions & 0 deletions Inbox/Inbox/InboxViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// InboxViewController.swift
// Inbox
//
// Created by Alan Westbrook on 3/17/15.
// Copyright (c) 2015 Marcelo Marfil. All rights reserved.
//

import Cocoa
import WebKit

class InboxViewController: NSViewController {
@IBOutlet var webView:WebView? = nil

override func viewDidLoad() {
super.viewDidLoad()
// Do view setup here.

webView?.customUserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.5.9 (KHTML, like Gecko) Version/8.0.5 Safari/600.5.9"

}

}

0 comments on commit 59e7220

Please sign in to comment.