shopify_app 14.1.0 → 14.2.0
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/CHANGELOG.md +4 -0
- data/app/assets/javascripts/shopify_app/redirect.js +9 -4
- data/app/assets/javascripts/shopify_app/storage_access.js +11 -3
- data/app/views/shopify_app/sessions/enable_cookies.html.erb +6 -6
- data/app/views/shopify_app/sessions/request_storage_access.html.erb +0 -5
- data/app/views/shopify_app/shared/redirect.html.erb +1 -6
- data/lib/shopify_app/version.rb +1 -1
- data/package.json +1 -1
- metadata +2 -3
- data/app/assets/javascripts/shopify_app/app_bridge_redirect.js +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb2a8dba3b13ca38af9a6645ce033602f9605a1302fb83a92029715d4331ae5f
|
4
|
+
data.tar.gz: e7b3a88c503f8422dca96c05c8ef20d90c8f987bc6a6ce3741ac371ac51b454f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a32e20a2cf0042fd6d68ba7c43dec78814852d6742f9190d30ac929f068ce4929a8c8cfec722be4aa399b90875ace6bd52a26cb533c728c37e59258ea8db92d
|
7
|
+
data.tar.gz: e16e9417de76b0d7cb78bd2f9501cd78fab1784a570640dd153d90641b92420e51f2eb137c3f47fb07ab6f9d72f66008a8201330db6eb5e75b785e669837667a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
//= require ./app_bridge_redirect.js
|
2
|
-
|
3
1
|
(function() {
|
4
2
|
function redirect() {
|
5
3
|
var redirectTargetElement = document.getElementById("redirection-target");
|
@@ -14,8 +12,15 @@
|
|
14
12
|
// If the current window is the 'parent', change the URL by setting location.href
|
15
13
|
window.top.location.href = targetInfo.url;
|
16
14
|
} else {
|
17
|
-
// If the current window is the 'child', change the parent's URL with
|
18
|
-
|
15
|
+
// If the current window is the 'child', change the parent's URL with postMessage
|
16
|
+
normalizedLink = document.createElement('a');
|
17
|
+
normalizedLink.href = targetInfo.url;
|
18
|
+
|
19
|
+
data = JSON.stringify({
|
20
|
+
message: 'Shopify.API.remoteRedirect',
|
21
|
+
data: {location: normalizedLink.href}
|
22
|
+
});
|
23
|
+
window.parent.postMessage(data, targetInfo.myshopifyUrl);
|
19
24
|
}
|
20
25
|
}
|
21
26
|
|
@@ -1,5 +1,3 @@
|
|
1
|
-
//= require ./app_bridge_redirect.js
|
2
|
-
|
3
1
|
(function() {
|
4
2
|
var ACCESS_GRANTED_STATUS = 'storage_access_granted';
|
5
3
|
var ACCESS_DENIED_STATUS = 'storage_access_denied';
|
@@ -13,7 +11,17 @@
|
|
13
11
|
}
|
14
12
|
|
15
13
|
StorageAccessHelper.prototype.redirectToAppTLD = function(storageAccessStatus) {
|
16
|
-
|
14
|
+
var normalizedLink = document.createElement('a');
|
15
|
+
|
16
|
+
normalizedLink.href = this.setNormalizedLink(storageAccessStatus);
|
17
|
+
|
18
|
+
data = JSON.stringify({
|
19
|
+
message: 'Shopify.API.remoteRedirect',
|
20
|
+
data: {
|
21
|
+
location: normalizedLink.href,
|
22
|
+
}
|
23
|
+
});
|
24
|
+
window.parent.postMessage(data, this.redirectData.myshopifyUrl);
|
17
25
|
}
|
18
26
|
|
19
27
|
StorageAccessHelper.prototype.redirectToAppsIndex = function() {
|
@@ -5,12 +5,6 @@
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
6
6
|
<base target="_top">
|
7
7
|
<title>Redirecting…</title>
|
8
|
-
<script src="https://unpkg.com/@shopify/app-bridge@^1"></script>
|
9
|
-
<script>
|
10
|
-
window.apiKey = "<%= ShopifyApp.configuration.api_key %>";
|
11
|
-
window.shopOrigin = "https://<%= @shop %>";
|
12
|
-
window.returnTo = "<%= params[:return_to] %>"
|
13
|
-
</script>
|
14
8
|
<%= render 'shopify_app/partials/layout_styles' %>
|
15
9
|
<%= render 'shopify_app/partials/typography_styles' %>
|
16
10
|
<%= render 'shopify_app/partials/card_styles' %>
|
@@ -20,6 +14,12 @@
|
|
20
14
|
display: none;
|
21
15
|
}
|
22
16
|
</style>
|
17
|
+
<script>
|
18
|
+
window.apiKey = "<%= ShopifyApp.configuration.api_key %>";
|
19
|
+
window.shopOrigin = "https://<%= @shop %>";
|
20
|
+
window.returnTo = "<%= params[:return_to] %>"
|
21
|
+
</script>
|
22
|
+
|
23
23
|
<%= javascript_include_tag('shopify_app/enable_cookies', crossorigin: 'anonymous', integrity: true) %>
|
24
24
|
</head>
|
25
25
|
<body>
|
@@ -5,11 +5,6 @@
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
6
6
|
<base target="_top">
|
7
7
|
<title>Redirecting…</title>
|
8
|
-
<script src="https://unpkg.com/@shopify/app-bridge@^1"></script>
|
9
|
-
<script>
|
10
|
-
window.apiKey = "<%= ShopifyApp.configuration.api_key %>";
|
11
|
-
window.shopOrigin = "https://<%= current_shopify_domain %>";
|
12
|
-
</script>
|
13
8
|
<%= render 'shopify_app/partials/layout_styles' %>
|
14
9
|
<%= render 'shopify_app/partials/typography_styles' %>
|
15
10
|
<%= render 'shopify_app/partials/card_styles' %>
|
@@ -1,15 +1,10 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
|
-
<html lang="
|
2
|
+
<html lang="en">
|
3
3
|
<head>
|
4
4
|
<meta charset="utf-8" />
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
6
6
|
<base target="_top">
|
7
7
|
<title>Redirecting…</title>
|
8
|
-
<script src="https://unpkg.com/@shopify/app-bridge@^1"></script>
|
9
|
-
<script>
|
10
|
-
window.apiKey = "<%= ShopifyApp.configuration.api_key %>";
|
11
|
-
window.shopOrigin = "https://<%= current_shopify_domain %>";
|
12
|
-
</script>
|
13
8
|
<%= javascript_include_tag('shopify_app/redirect', crossorigin: 'anonymous', integrity: true) %>
|
14
9
|
</head>
|
15
10
|
<body>
|
data/lib/shopify_app/version.rb
CHANGED
data/package.json
CHANGED
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: 14.
|
4
|
+
version: 14.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: browser_sniffer
|
@@ -258,7 +258,6 @@ files:
|
|
258
258
|
- Rakefile
|
259
259
|
- SECURITY.md
|
260
260
|
- app/assets/images/storage_access.svg
|
261
|
-
- app/assets/javascripts/shopify_app/app_bridge_redirect.js
|
262
261
|
- app/assets/javascripts/shopify_app/enable_cookies.js
|
263
262
|
- app/assets/javascripts/shopify_app/itp_helper.js
|
264
263
|
- app/assets/javascripts/shopify_app/partition_cookies.js
|
@@ -1,18 +0,0 @@
|
|
1
|
-
(function(window) {
|
2
|
-
function appBridgeRedirect(url) {
|
3
|
-
var AppBridge = window['app-bridge'];
|
4
|
-
var createApp = AppBridge.default;
|
5
|
-
var Redirect = AppBridge.actions.Redirect;
|
6
|
-
var app = createApp({
|
7
|
-
apiKey: window.apiKey,
|
8
|
-
shopOrigin: window.shopOrigin.replace(/^https:\/\//, ''),
|
9
|
-
});
|
10
|
-
|
11
|
-
var normalizedLink = document.createElement('a');
|
12
|
-
normalizedLink.href = url;
|
13
|
-
|
14
|
-
Redirect.create(app).dispatch(Redirect.Action.REMOTE, normalizedLink.href);
|
15
|
-
}
|
16
|
-
|
17
|
-
window.appBridgeRedirect = appBridgeRedirect;
|
18
|
-
})(window);
|