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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0cef856d1dd01d84abd5dfaf56c4e72f1913ed1299a279cef6cbdb050a344d14
4
- data.tar.gz: a548286f028a040cf9081512cb56547643d2eefdcc07861d3dac0f03a105bd4d
3
+ metadata.gz: b9f4a168ace8cc683153ac2792ec3f453ea966771f15d14f7087ed6e5b2ca9fa
4
+ data.tar.gz: e2c86bb86c0fca2c9f2d915041e0bd7b5f81bb6412ef54ee8a60ce0a3db9b31e
5
5
  SHA512:
6
- metadata.gz: 122819e31ab8b0cea3ed0e2d11a594ef6c519864dd0f864d266e0782cd6934e269aba4eaa909d1d67ddb2a608aa356c0da6cf90d9722ead983cb626fee8fc92a
7
- data.tar.gz: 63233fcba0572fbdf4b471b008b2cfe235bfae903ff8c854ac518ae7480c613251bc470f0b97d78ee6b429ab5bc47c96bda6e0b6e552cf88881df331c6c6f55b
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cocoawebview
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.7"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoawebview
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tommy Jeff