cocoawebview 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/cocoawebview/cocoawebview.m +10 -0
- data/lib/cocoawebview/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9f4a168ace8cc683153ac2792ec3f453ea966771f15d14f7087ed6e5b2ca9fa
|
4
|
+
data.tar.gz: e2c86bb86c0fca2c9f2d915041e0bd7b5f81bb6412ef54ee8a60ce0a3db9b31e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f811c8dafea57c643bc2dfcf65b9f60460ca9d2635c6e7840266a14d1cfe8a9553f7e606e0832f93f6923ae7787a9e6f81ad22b389e62e249151f4af5257953
|
7
|
+
data.tar.gz: e8c9ce7a9edc78a19eb25a24d47cb465ae8624c59674121c8c65ba069e11bf927f9d9ddf1d3156d582ead94b6dee6d9682943179f61938b1c5ba7a1b88fcc63e
|
@@ -62,6 +62,15 @@ VALUE webview_eval(VALUE self, VALUE code);
|
|
62
62
|
return self;
|
63
63
|
}
|
64
64
|
|
65
|
+
- (void)close {
|
66
|
+
[self orderOut:nil]; // Hide instead of destroy
|
67
|
+
}
|
68
|
+
|
69
|
+
- (void)windowWillClose:(NSNotification *)notification {
|
70
|
+
// Prevent release by hiding the window instead
|
71
|
+
[notification.object orderOut:nil];
|
72
|
+
}
|
73
|
+
|
65
74
|
- (void)userContentController:(WKUserContentController *)userContentController
|
66
75
|
didReceiveScriptMessage:(WKScriptMessage *)message {
|
67
76
|
if ([message.name isEqualToString:@"native"]) {
|
@@ -184,6 +193,7 @@ VALUE webview_initialize(VALUE self, VALUE debug) {
|
|
184
193
|
}
|
185
194
|
CocoaWebview *webview = [[CocoaWebview alloc] initWithFrame:NSMakeRect(100, 100, 400, 500) debug:flag];
|
186
195
|
|
196
|
+
[webview setReleasedWhenClosed:NO];
|
187
197
|
[webview setCocoaWebview:self];
|
188
198
|
|
189
199
|
// Wrap the Objective-C pointer into a Ruby object
|
data/lib/cocoawebview/version.rb
CHANGED