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

Commit 4f83a17

Browse files
#223 Don't start a new webserver after a crash if one is still running
1 parent 0b4682d commit 4f83a17

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ $ cordova plugin add cordova-plugin-wkwebview --variable WKWEBVIEW_SERVER_PORT=1
5757
No need for anything else - you can now open the project in XCode 6 if you like.
5858

5959
## 4. Changelog
60-
ApiAISDKPlugin
61-
* __0.6.8__ Compatibility with Telerik's LivePatch plugin. See #202.
60+
* __0.6.9__ Don't start a new webserver after a crash if one is still running. See #223.
61+
* __0.6.8__ Compatibility with Telerik's LivePatch plugin. See #202.
6262
* __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!
6363
* __0.6.5__ `KeyboardDisplayRequiresUserAction` works! So set to `false` if you want the keyboard to pop up when programmatically focussing an input field.
6464
* __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').

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.6.7",
2+
"version": "0.6.9",
33
"name": "cordova-plugin-wkwebview",
44
"cordova_name": "WKWebView Polyfill",
55
"description": "A drop-in replacement of UIWebView for boosted performance and enhanced HTML5 support",

plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
33
id="com.telerik.plugins.wkwebview"
4-
version="0.6.8">
4+
version="0.6.9">
55

66
<name>WKWebView Polyfill</name>
77

src/ios/AppDelegate+WKWebViewPolyfill.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ - (void) createWindowAndStartWebServer:(BOOL) startWebServer {
4444
// Note: the embedded webserver is still needed for iOS 9. It's not needed to load index.html,
4545
// but we need it to ajax-load files (file:// protocol has no origin, leading to CORS issues).
4646
NSString *directoryPath = myMainViewController.wwwFolderName;
47+
48+
// don't restart the webserver if we don't have to (fi. after a crash, see #223)
49+
if (_webServer != nil && [_webServer isRunning]) {
50+
[myMainViewController setServerPort:_webServer.port];
51+
return;
52+
}
53+
4754
_webServer = [[GCDWebServer alloc] init];
4855
_webServerOptions = [NSMutableDictionary dictionary];
4956

0 commit comments

Comments
 (0)