shopify_app 11.7.1 → 12.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/README.md +6 -0
- data/app/assets/javascripts/shopify_app/itp_helper.js +6 -6
- data/app/assets/javascripts/shopify_app/storage_access.js +35 -6
- data/app/controllers/shopify_app/sessions_controller.rb +22 -9
- data/app/views/shopify_app/sessions/enable_cookies.html.erb +1 -1
- data/app/views/shopify_app/sessions/request_storage_access.html.erb +1 -1
- data/config/locales/pt-BR.yml +1 -1
- data/lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb +1 -5
- data/lib/generators/shopify_app/home_controller/home_controller_generator.rb +0 -6
- data/lib/generators/shopify_app/install/templates/embedded_app.html.erb +2 -2
- data/lib/generators/shopify_app/install/templates/flash_messages.js +11 -2
- data/lib/generators/shopify_app/install/templates/shopify_app.js +9 -3
- data/lib/shopify_app/configuration.rb +1 -1
- data/lib/shopify_app/controller_concerns/login_protection.rb +21 -3
- data/lib/shopify_app/engine.rb +1 -1
- data/lib/shopify_app/middleware/same_site_cookie_middleware.rb +20 -13
- data/lib/shopify_app/version.rb +1 -1
- data/package.json +2 -2
- data/shopify_app.gemspec +1 -1
- metadata +4 -5
- data/lib/generators/shopify_app/home_controller/templates/shopify_app_ready_script.html.erb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97b51956c46bc3fa2f253b3a2a949bb65f338999b46cd28ec182c4774f6d2b01
|
4
|
+
data.tar.gz: 1f8199a550dfd21035e620e052b636c3c8956ae820c47385a80cc58981a78802
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10004812203cadeaa93607ef0726bb0f96d541b363da568bb379260b9861773392050a42ab99fbabca69517d0851deb4263ba2de7f4f8c33865c6e83b2f71772
|
7
|
+
data.tar.gz: a777827c69680e90cf514cd0409039d393c1f7a6c0c523f6d3a61b6dd01cd2e3bfcfbe5ea67aa42bd9e4c8b2a57cd53d9d27a6378833055d47bf4745c155fc2f
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,28 @@
|
|
1
|
+
12.0.4
|
2
|
+
------
|
3
|
+
* Reverts reverted PR (#895) #897
|
4
|
+
|
5
|
+
12.0.3
|
6
|
+
------
|
7
|
+
* Moves samesite middleware higher in the stack #898
|
8
|
+
* Fix issue where not redirecting user to granted storage page casues infinite loop #900
|
9
|
+
|
10
|
+
12.0.2
|
11
|
+
------
|
12
|
+
* Reverts "Fix for return_to in safari after enable_cookies/granted_storage_access" introduced in 12.0.1
|
13
|
+
|
14
|
+
12.0.1
|
15
|
+
------
|
16
|
+
* disable samesite cookie middleware in tests
|
17
|
+
* middleware compatibility for ruby 2.3
|
18
|
+
* samesite cookie fixes for javascript libraries
|
19
|
+
* change generators to add AppBridge instead of EASDK
|
20
|
+
* Fix for return_to in safari after enable_cookies/granted_storage_access
|
21
|
+
|
22
|
+
12.0.0
|
23
|
+
-----
|
24
|
+
* Updating shopify_api gem to 9.0.0
|
25
|
+
|
1
26
|
11.7.1
|
2
27
|
-----
|
3
28
|
* Fix to allow SessionStorage to be flexible on what model names that the are used for storing shop and user data
|
data/README.md
CHANGED
@@ -439,6 +439,11 @@ end
|
|
439
439
|
Create your app proxy url in the [Shopify Partners' Dashboard][dashboard], making sure to point it to `https://your_app_website.com/app_proxy`.
|
440
440
|
![Creating an App Proxy](/images/app-proxy-screenshot.png)
|
441
441
|
|
442
|
+
App Bridge
|
443
|
+
---
|
444
|
+
|
445
|
+
A basic example of using [App Bridge][app-bridge] is included in the install generator. An app instance is automatically initialized in [shopify_app.js](https://github.com/Shopify/shopify_app/blob/master/lib/generators/shopify_app/install/templates/shopify_app.js) and [flash_messages.js](https://github.com/Shopify/shopify_app/blob/master/lib/generators/shopify_app/install/templates/flash_messages.js) converts Rails [flash messages](https://api.rubyonrails.org/classes/ActionDispatch/Flash.html) to App Bridge Toast actions automatically. By default, this library is included via [unpkg in the embedded_app layout](https://github.com/Shopify/shopify_app/blob/master/lib/generators/shopify_app/install/templates/embedded_app.html.erb#L27). For more advanced uses it is recommended to [install App Bridge via npm or yarn](https://help.shopify.com/en/api/embedded-apps/app-bridge/getting-started#set-up-shopify-app-bridge-in-your-app).
|
446
|
+
|
442
447
|
Troubleshooting
|
443
448
|
---------------
|
444
449
|
|
@@ -537,3 +542,4 @@ is changed to
|
|
537
542
|
You will need to also follow the ShopifyAPI [upgrade guide](https://github.com/Shopify/shopify_api/blob/master/README.md#-breaking-change-notice-for-version-700-) to ensure your app is ready to work with api versioning.
|
538
543
|
|
539
544
|
[dashboard]:https://partners.shopify.com
|
545
|
+
[app-bridge]:https://help.shopify.com/en/api/embedded-apps/app-bridge
|
@@ -4,31 +4,31 @@
|
|
4
4
|
this.itpAction = document.getElementById('TopLevelInteractionButton');
|
5
5
|
this.redirectUrl = opts.redirectUrl;
|
6
6
|
}
|
7
|
-
|
7
|
+
|
8
8
|
ITPHelper.prototype.redirect = function() {
|
9
9
|
sessionStorage.setItem('shopify.top_level_interaction', true);
|
10
10
|
window.location.href = this.redirectUrl;
|
11
11
|
}
|
12
|
-
|
12
|
+
|
13
13
|
ITPHelper.prototype.userAgentIsAffected = function() {
|
14
14
|
return Boolean(document.hasStorageAccess);
|
15
15
|
}
|
16
|
-
|
16
|
+
|
17
17
|
ITPHelper.prototype.canPartitionCookies = function() {
|
18
18
|
var versionRegEx = /Version\/12\.0\.?\d? Safari/;
|
19
19
|
return versionRegEx.test(navigator.userAgent);
|
20
20
|
}
|
21
|
-
|
21
|
+
|
22
22
|
ITPHelper.prototype.setUpContent = function(onClick) {
|
23
23
|
this.itpContent.style.display = 'block';
|
24
24
|
this.itpAction.addEventListener('click', this.redirect.bind(this));
|
25
25
|
}
|
26
|
-
|
26
|
+
|
27
27
|
ITPHelper.prototype.execute = function() {
|
28
28
|
if (!this.itpContent) {
|
29
29
|
return;
|
30
30
|
}
|
31
|
-
|
31
|
+
|
32
32
|
if (this.userAgentIsAffected()) {
|
33
33
|
this.setUpContent();
|
34
34
|
} else {
|
@@ -28,18 +28,47 @@
|
|
28
28
|
window.parent.location.href = this.redirectData.myshopifyUrl + '/admin/apps';
|
29
29
|
}
|
30
30
|
|
31
|
-
StorageAccessHelper.prototype.
|
32
|
-
window.location.href = this.redirectData.
|
31
|
+
StorageAccessHelper.prototype.redirectToAppTargetUrl = function() {
|
32
|
+
window.location.href = this.redirectData.appTargetUrl;
|
33
|
+
}
|
34
|
+
|
35
|
+
StorageAccessHelper.prototype.sameSiteNoneIncompatible = function(ua) {
|
36
|
+
return ua.includes("iPhone OS 12_") || ua.includes("iPad; CPU OS 12_") || //iOS 12
|
37
|
+
(ua.includes("UCBrowser/")
|
38
|
+
? this.isOlderUcBrowser(ua) //UC Browser < 12.13.2
|
39
|
+
: (ua.includes("Chrome/5") || ua.includes("Chrome/6"))) ||
|
40
|
+
ua.includes("Chromium/5") || ua.includes("Chromium/6") ||
|
41
|
+
(ua.includes(" OS X 10_14_") &&
|
42
|
+
((ua.includes("Version/") && ua.includes("Safari")) || //Safari on MacOS 10.14
|
43
|
+
ua.endsWith("(KHTML, like Gecko)"))); //Web view on MacOS 10.14
|
44
|
+
}
|
45
|
+
|
46
|
+
StorageAccessHelper.prototype.isOlderUcBrowser = function(ua) {
|
47
|
+
var match = ua.match(/UCBrowser\/(\d+)\.(\d+)\.(\d+)\./);
|
48
|
+
if (!match) return false;
|
49
|
+
var major = parseInt(match[1]);
|
50
|
+
var minor = parseInt(match[2]);
|
51
|
+
var build = parseInt(match[3]);
|
52
|
+
if (major != 12) return major < 12;
|
53
|
+
if (minor != 13) return minor < 13;
|
54
|
+
return build < 2;
|
55
|
+
}
|
56
|
+
|
57
|
+
StorageAccessHelper.prototype.setCookie = function(value) {
|
58
|
+
if(!this.sameSiteNoneIncompatible(navigator.userAgent)) {
|
59
|
+
value += '; secure; SameSite=None'
|
60
|
+
}
|
61
|
+
document.cookie = value;
|
33
62
|
}
|
34
63
|
|
35
64
|
StorageAccessHelper.prototype.grantedStorageAccess = function() {
|
36
65
|
try {
|
37
66
|
sessionStorage.setItem('shopify.granted_storage_access', true);
|
38
|
-
|
67
|
+
this.setCookie('shopify.granted_storage_access=true');
|
39
68
|
if (!document.cookie) {
|
40
69
|
throw 'Cannot set third-party cookie.'
|
41
70
|
}
|
42
|
-
this.
|
71
|
+
this.redirectToAppTargetUrl();
|
43
72
|
} catch (error) {
|
44
73
|
console.warn('Third party cookies may be blocked.', error);
|
45
74
|
this.redirectToAppTLD(ACCESS_DENIED_STATUS);
|
@@ -61,7 +90,7 @@
|
|
61
90
|
StorageAccessHelper.prototype.handleHasStorageAccess = function() {
|
62
91
|
if (sessionStorage.getItem('shopify.granted_storage_access')) {
|
63
92
|
// If app was classified by ITP and used Storage Access API to acquire access
|
64
|
-
this.
|
93
|
+
this.redirectToAppTargetUrl();
|
65
94
|
} else {
|
66
95
|
// If app has not been classified by ITP and still has storage access
|
67
96
|
this.redirectToAppTLD(ACCESS_GRANTED_STATUS);
|
@@ -107,7 +136,7 @@
|
|
107
136
|
}
|
108
137
|
|
109
138
|
StorageAccessHelper.prototype.setCookieAndRedirect = function() {
|
110
|
-
|
139
|
+
this.setCookie('shopify.cookies_persist=true');
|
111
140
|
var helper = this.setUpHelper();
|
112
141
|
helper.redirect();
|
113
142
|
}
|
@@ -20,11 +20,15 @@ module ShopifyApp
|
|
20
20
|
|
21
21
|
render(:enable_cookies, layout: false, locals: {
|
22
22
|
does_not_have_storage_access_url: top_level_interaction_path(
|
23
|
-
shop: sanitized_shop_name
|
23
|
+
shop: sanitized_shop_name,
|
24
|
+
return_to: params[:return_to]
|
24
25
|
),
|
25
26
|
has_storage_access_url: login_url_with_optional_shop(top_level: true),
|
26
|
-
|
27
|
-
|
27
|
+
app_target_url: granted_storage_access_path(
|
28
|
+
shop: sanitized_shop_name,
|
29
|
+
return_to: params[:return_to]
|
30
|
+
),
|
31
|
+
current_shopify_domain: current_shopify_domain
|
28
32
|
})
|
29
33
|
end
|
30
34
|
|
@@ -38,8 +42,9 @@ module ShopifyApp
|
|
38
42
|
|
39
43
|
session['shopify.granted_storage_access'] = true
|
40
44
|
|
41
|
-
|
42
|
-
|
45
|
+
copy_return_to_param_to_session
|
46
|
+
|
47
|
+
redirect_to(return_address_with_params({ shop: @shop }))
|
43
48
|
end
|
44
49
|
|
45
50
|
def destroy
|
@@ -54,7 +59,7 @@ module ShopifyApp
|
|
54
59
|
return render_invalid_shop_error unless sanitized_shop_name.present?
|
55
60
|
session['shopify.omniauth_params'] = { shop: sanitized_shop_name }
|
56
61
|
|
57
|
-
|
62
|
+
copy_return_to_param_to_session
|
58
63
|
|
59
64
|
if user_agent_can_partition_cookies
|
60
65
|
authenticate_with_partitioning
|
@@ -93,6 +98,10 @@ module ShopifyApp
|
|
93
98
|
true
|
94
99
|
end
|
95
100
|
|
101
|
+
def copy_return_to_param_to_session
|
102
|
+
session[:return_to] = params[:return_to] if params[:return_to]
|
103
|
+
end
|
104
|
+
|
96
105
|
def render_invalid_shop_error
|
97
106
|
flash[:error] = I18n.t('invalid_shop_url')
|
98
107
|
redirect_to return_address
|
@@ -133,11 +142,15 @@ module ShopifyApp
|
|
133
142
|
layout: false,
|
134
143
|
locals: {
|
135
144
|
does_not_have_storage_access_url: top_level_interaction_path(
|
136
|
-
shop: sanitized_shop_name
|
145
|
+
shop: sanitized_shop_name,
|
146
|
+
return_to: session[:return_to]
|
137
147
|
),
|
138
148
|
has_storage_access_url: login_url_with_optional_shop(top_level: true),
|
139
|
-
|
140
|
-
|
149
|
+
app_target_url: granted_storage_access_path(
|
150
|
+
shop: sanitized_shop_name,
|
151
|
+
return_to: session[:return_to]
|
152
|
+
),
|
153
|
+
current_shopify_domain: current_shopify_domain
|
141
154
|
}
|
142
155
|
)
|
143
156
|
end
|
@@ -32,7 +32,7 @@
|
|
32
32
|
myshopifyUrl: "https://#{current_shopify_domain}",
|
33
33
|
hasStorageAccessUrl: "#{has_storage_access_url}",
|
34
34
|
doesNotHaveStorageAccessUrl: "#{does_not_have_storage_access_url}",
|
35
|
-
|
35
|
+
appTargetUrl: "#{app_target_url}"
|
36
36
|
},
|
37
37
|
},
|
38
38
|
)
|
@@ -24,7 +24,7 @@
|
|
24
24
|
myshopifyUrl: "https://#{current_shopify_domain}",
|
25
25
|
hasStorageAccessUrl: "#{has_storage_access_url}",
|
26
26
|
doesNotHaveStorageAccessUrl: "#{does_not_have_storage_access_url}",
|
27
|
-
|
27
|
+
appTargetUrl: "#{app_target_url}"
|
28
28
|
},
|
29
29
|
},
|
30
30
|
)
|
data/config/locales/pt-BR.yml
CHANGED
@@ -4,7 +4,7 @@ pt-BR:
|
|
4
4
|
could_not_log_in: Não foi possível fazer login na Shopify store
|
5
5
|
invalid_shop_url: Domínio de loja inválido
|
6
6
|
enable_cookies_heading: Habilitar cookies de %{app}
|
7
|
-
enable_cookies_body: Você
|
7
|
+
enable_cookies_body: Você precisa habilitar manualmente os cookies neste navegador
|
8
8
|
para usar %{app} dentro da Shopify.
|
9
9
|
enable_cookies_footer: Os cookies permitem que o app o autentique armazenando temporariamente
|
10
10
|
suas preferências e dados pessoais. Eles expiram depois de 30 dias.
|
@@ -3,11 +3,7 @@
|
|
3
3
|
class MarketingActivitiesController < ShopifyApp::ExtensionVerificationController
|
4
4
|
def preload_form_data
|
5
5
|
preload_data = {
|
6
|
-
"form_data": {
|
7
|
-
"budget": {
|
8
|
-
"currency": "USD",
|
9
|
-
}
|
10
|
-
}
|
6
|
+
"form_data": {}
|
11
7
|
}
|
12
8
|
render(json: preload_data, status: :ok)
|
13
9
|
end
|
@@ -11,12 +11,6 @@ module ShopifyApp
|
|
11
11
|
|
12
12
|
def create_home_index_view
|
13
13
|
copy_file 'index.html.erb', 'app/views/home/index.html.erb'
|
14
|
-
if embedded_app?
|
15
|
-
prepend_to_file(
|
16
|
-
'app/views/home/index.html.erb',
|
17
|
-
File.read(File.expand_path(find_in_source_paths('shopify_app_ready_script.html.erb')))
|
18
|
-
)
|
19
|
-
end
|
20
14
|
end
|
21
15
|
|
22
16
|
def add_home_index_route
|
@@ -24,11 +24,11 @@
|
|
24
24
|
|
25
25
|
<%= render 'layouts/flash_messages' %>
|
26
26
|
|
27
|
-
<script src="https://
|
27
|
+
<script src="https://unpkg.com/@shopify/app-bridge"></script>
|
28
28
|
|
29
29
|
<%= content_tag(:div, nil, id: 'shopify-app-init', data: {
|
30
30
|
api_key: ShopifyApp.configuration.api_key,
|
31
|
-
shop_origin: (
|
31
|
+
shop_origin: (@shop_session.domain if @shop_session),
|
32
32
|
debug: Rails.env.development?
|
33
33
|
} ) %>
|
34
34
|
|
@@ -4,12 +4,21 @@ if (!document.documentElement.hasAttribute("data-turbolinks-preview")) {
|
|
4
4
|
document.addEventListener(eventName, function flash() {
|
5
5
|
var flashData = JSON.parse(document.getElementById('shopify-app-flash').dataset.flash);
|
6
6
|
|
7
|
+
var Toast = window['app-bridge'].actions.Toast;
|
8
|
+
|
7
9
|
if (flashData.notice) {
|
8
|
-
|
10
|
+
Toast.create(app, {
|
11
|
+
message: flashData.notice,
|
12
|
+
duration: 5000,
|
13
|
+
}).dispatch(Toast.Action.SHOW);
|
9
14
|
}
|
10
15
|
|
11
16
|
if (flashData.error) {
|
12
|
-
|
17
|
+
Toast.create(app, {
|
18
|
+
message: flashData.error,
|
19
|
+
duration: 5000,
|
20
|
+
isError: true,
|
21
|
+
}).dispatch(Toast.Action.SHOW);
|
13
22
|
}
|
14
23
|
|
15
24
|
document.removeEventListener(eventName, flash)
|
@@ -1,9 +1,15 @@
|
|
1
1
|
document.addEventListener('DOMContentLoaded', () => {
|
2
2
|
var data = document.getElementById('shopify-app-init').dataset;
|
3
|
-
|
3
|
+
var AppBridge = window['app-bridge'];
|
4
|
+
var createApp = AppBridge.default;
|
5
|
+
window.app = createApp({
|
4
6
|
apiKey: data.apiKey,
|
5
7
|
shopOrigin: data.shopOrigin,
|
6
|
-
|
7
|
-
|
8
|
+
});
|
9
|
+
|
10
|
+
var actions = AppBridge.actions;
|
11
|
+
var TitleBar = actions.TitleBar;
|
12
|
+
TitleBar.create(app, {
|
13
|
+
title: data.page,
|
8
14
|
});
|
9
15
|
});
|
@@ -63,8 +63,14 @@ module ShopifyApp
|
|
63
63
|
head :unauthorized
|
64
64
|
else
|
65
65
|
if request.get?
|
66
|
-
|
66
|
+
path = request.path
|
67
|
+
query = sanitized_params.to_query
|
68
|
+
else
|
69
|
+
referer = URI(request.referer || "/")
|
70
|
+
path = referer.path
|
71
|
+
query = "#{referer.query}&#{sanitized_params.to_query}"
|
67
72
|
end
|
73
|
+
session[:return_to] = "#{path}?#{query}"
|
68
74
|
redirect_to(login_url_with_optional_shop)
|
69
75
|
end
|
70
76
|
end
|
@@ -94,8 +100,10 @@ module ShopifyApp
|
|
94
100
|
query_params = {}
|
95
101
|
query_params[:shop] = sanitized_params[:shop] if params[:shop].present?
|
96
102
|
|
97
|
-
|
98
|
-
|
103
|
+
return_to = session[:return_to] || params[:return_to]
|
104
|
+
|
105
|
+
if return_to.present? && return_to_param_required?
|
106
|
+
query_params[:return_to] = return_to
|
99
107
|
end
|
100
108
|
|
101
109
|
has_referer_shop_name = referer_sanitized_shop_name.present?
|
@@ -159,5 +167,15 @@ module ShopifyApp
|
|
159
167
|
def return_address
|
160
168
|
session.delete(:return_to) || ShopifyApp.configuration.root_url
|
161
169
|
end
|
170
|
+
|
171
|
+
def return_address_with_params(params)
|
172
|
+
uri = URI(return_address)
|
173
|
+
uri.query = CGI.parse(uri.query.to_s)
|
174
|
+
.symbolize_keys
|
175
|
+
.transform_values { |v| v.one? ? v.first : v }
|
176
|
+
.merge(params)
|
177
|
+
.to_query
|
178
|
+
uri.to_s
|
179
|
+
end
|
162
180
|
end
|
163
181
|
end
|
data/lib/shopify_app/engine.rb
CHANGED
@@ -14,7 +14,7 @@ module ShopifyApp
|
|
14
14
|
end
|
15
15
|
|
16
16
|
initializer "shopify_app.middleware" do |app|
|
17
|
-
app.config.middleware.
|
17
|
+
app.config.middleware.insert_after(::Rack::Runtime, ShopifyApp::SameSiteCookieMiddleware)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -1,25 +1,32 @@
|
|
1
1
|
module ShopifyApp
|
2
2
|
class SameSiteCookieMiddleware
|
3
|
+
COOKIE_SEPARATOR = "\n"
|
4
|
+
|
3
5
|
def initialize(app)
|
4
6
|
@app = app
|
5
7
|
end
|
6
8
|
|
7
9
|
def call(env)
|
8
|
-
|
9
|
-
ensure
|
10
|
+
status, headers, body = @app.call(env)
|
10
11
|
user_agent = env['HTTP_USER_AGENT']
|
11
12
|
|
12
|
-
if headers && headers['Set-Cookie'] &&
|
13
|
+
if headers && headers['Set-Cookie'] &&
|
14
|
+
!SameSiteCookieMiddleware.same_site_none_incompatible?(user_agent) &&
|
13
15
|
ShopifyApp.configuration.enable_same_site_none
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
set_cookies = headers['Set-Cookie']
|
18
|
+
.split(COOKIE_SEPARATOR)
|
19
|
+
.compact
|
20
|
+
.map do |cookie|
|
21
|
+
cookie << '; Secure' if not cookie =~ /;\s*secure/i
|
22
|
+
cookie << '; SameSite=None' unless cookie =~ /;\s*samesite=/i
|
23
|
+
cookie
|
20
24
|
end
|
21
|
-
|
25
|
+
|
26
|
+
headers['Set-Cookie'] = set_cookies.join(COOKIE_SEPARATOR)
|
22
27
|
end
|
28
|
+
|
29
|
+
[status, headers, body]
|
23
30
|
end
|
24
31
|
|
25
32
|
def self.same_site_none_incompatible?(user_agent)
|
@@ -31,8 +38,8 @@ module ShopifyApp
|
|
31
38
|
end
|
32
39
|
|
33
40
|
def self.webkit_same_site_bug?(sniffer)
|
34
|
-
(sniffer.os == :ios && sniffer.os_version.match
|
35
|
-
(sniffer.os == :mac && sniffer.browser == :safari && sniffer.os_version.match
|
41
|
+
(sniffer.os == :ios && sniffer.os_version.match(/^([0-9]|1[12])[\.\_]/)) ||
|
42
|
+
(sniffer.os == :mac && sniffer.browser == :safari && sniffer.os_version.match(/^10[\.\_]14/))
|
36
43
|
end
|
37
44
|
|
38
45
|
def self.drops_unrecognized_same_site_cookies?(sniffer)
|
@@ -41,11 +48,11 @@ module ShopifyApp
|
|
41
48
|
end
|
42
49
|
|
43
50
|
def self.chromium_based?(sniffer)
|
44
|
-
sniffer.browser_name.downcase.match
|
51
|
+
sniffer.browser_name.downcase.match(/chrom(e|ium)/)
|
45
52
|
end
|
46
53
|
|
47
54
|
def self.uc_browser?(sniffer)
|
48
|
-
sniffer.user_agent.downcase.match
|
55
|
+
sniffer.user_agent.downcase.match(/uc\s?browser/)
|
49
56
|
end
|
50
57
|
|
51
58
|
def self.uc_browser_version_at_least?(sniffer:, major:, minor:, build:)
|
data/lib/shopify_app/version.rb
CHANGED
data/package.json
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "shopify_app",
|
3
|
+
"version": "12.0.2",
|
3
4
|
"repository": "git@github.com:Shopify/shopify_app.git",
|
4
5
|
"author": "Shopify",
|
5
6
|
"license": "MIT",
|
@@ -23,6 +24,5 @@
|
|
23
24
|
},
|
24
25
|
"scripts": {
|
25
26
|
"test": "./node_modules/.bin/karma start --browsers ChromeHeadless --single-run"
|
26
|
-
}
|
27
|
-
"version": "11.7.1"
|
27
|
+
}
|
28
28
|
}
|
data/shopify_app.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.add_runtime_dependency('browser_sniffer', '~> 1.1.3')
|
14
14
|
s.add_runtime_dependency('rails', '> 5.2.1')
|
15
|
-
s.add_runtime_dependency('shopify_api', '~>
|
15
|
+
s.add_runtime_dependency('shopify_api', '~> 9.0')
|
16
16
|
s.add_runtime_dependency('omniauth-shopify-oauth2', '~> 2.2.0')
|
17
17
|
|
18
18
|
s.add_development_dependency('rake')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopify_app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 12.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: browser_sniffer
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '9.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '9.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: omniauth-shopify-oauth2
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -298,7 +298,6 @@ files:
|
|
298
298
|
- lib/generators/shopify_app/home_controller/home_controller_generator.rb
|
299
299
|
- lib/generators/shopify_app/home_controller/templates/home_controller.rb
|
300
300
|
- lib/generators/shopify_app/home_controller/templates/index.html.erb
|
301
|
-
- lib/generators/shopify_app/home_controller/templates/shopify_app_ready_script.html.erb
|
302
301
|
- lib/generators/shopify_app/install/install_generator.rb
|
303
302
|
- lib/generators/shopify_app/install/templates/_flash_messages.html.erb
|
304
303
|
- lib/generators/shopify_app/install/templates/embedded_app.html.erb
|