Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Commit

Permalink
#223 Don't start a new webserver after a crash if one is still running
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Feb 14, 2016
1 parent 0b4682d commit 4f83a17
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ $ cordova plugin add cordova-plugin-wkwebview --variable WKWEBVIEW_SERVER_PORT=1
No need for anything else - you can now open the project in XCode 6 if you like.

## 4. Changelog
ApiAISDKPlugin
* __0.6.8__ Compatibility with Telerik's LivePatch plugin. See #202.
* __0.6.9__ Don't start a new webserver after a crash if one is still running. See #223.
* __0.6.8__ Compatibility with Telerik's LivePatch plugin. See #202.
* __0.6.7__ Compatibility with `file://` protocol for usage in plugins like [cordova-hot-code-push](https://github.com/nordnet/cordova-hot-code-push), thanks #195 and #196!
* __0.6.5__ `KeyboardDisplayRequiresUserAction` works! So set to `false` if you want the keyboard to pop up when programmatically focussing an input field.
* __0.6.4__ On top of the port preference introduced in 0.6.3 you can now override the default variable when installing this plugin (see 'Installation').
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.6.7",
"version": "0.6.9",
"name": "cordova-plugin-wkwebview",
"cordova_name": "WKWebView Polyfill",
"description": "A drop-in replacement of UIWebView for boosted performance and enhanced HTML5 support",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="com.telerik.plugins.wkwebview"
version="0.6.8">
version="0.6.9">

<name>WKWebView Polyfill</name>

Expand Down
7 changes: 7 additions & 0 deletions src/ios/AppDelegate+WKWebViewPolyfill.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ - (void) createWindowAndStartWebServer:(BOOL) startWebServer {
// Note: the embedded webserver is still needed for iOS 9. It's not needed to load index.html,
// but we need it to ajax-load files (file:// protocol has no origin, leading to CORS issues).
NSString *directoryPath = myMainViewController.wwwFolderName;

// don't restart the webserver if we don't have to (fi. after a crash, see #223)
if (_webServer != nil && [_webServer isRunning]) {
[myMainViewController setServerPort:_webServer.port];
return;
}

_webServer = [[GCDWebServer alloc] init];
_webServerOptions = [NSMutableDictionary dictionary];

Expand Down

0 comments on commit 4f83a17

Please sign in to comment.