shopify_app 14.1.0 → 14.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db65febc756d6f85ea5ee8f2d109e5e8fa8087ed4b1eaa3df2e1d0abfa33e95c
4
- data.tar.gz: 74c591a7dc4f9f6d0fc88f5be084decd7746a6052a72698e34938caeb8b4ef49
3
+ metadata.gz: eb2a8dba3b13ca38af9a6645ce033602f9605a1302fb83a92029715d4331ae5f
4
+ data.tar.gz: e7b3a88c503f8422dca96c05c8ef20d90c8f987bc6a6ce3741ac371ac51b454f
5
5
  SHA512:
6
- metadata.gz: 76e46bf49ceb4d417df9e414c2bb957bff0726f8a1e54bcb87df36a19ec1efe7b32c71dda81b8f1d0425acfccedd375149c5e975ac7f7281d3bb62136d578b49
7
- data.tar.gz: e2459eb498a8b220d888fc1412231b2ce736cd779a4cfac6aa9fa1ce61cbe111a17d2a89427d6e0e38e67a9b3c201a5c0cfcba63c624dcdc27dbd5d8417dd47c
6
+ metadata.gz: 9a32e20a2cf0042fd6d68ba7c43dec78814852d6742f9190d30ac929f068ce4929a8c8cfec722be4aa399b90875ace6bd52a26cb533c728c37e59258ea8db92d
7
+ data.tar.gz: e16e9417de76b0d7cb78bd2f9501cd78fab1784a570640dd153d90641b92420e51f2eb137c3f47fb07ab6f9d72f66008a8201330db6eb5e75b785e669837667a
@@ -1,3 +1,7 @@
1
+ 14.2.0
2
+ ------
3
+ * Revert "Replace redirect calls to use App Bridge redirect functionality"
4
+
1
5
  14.1.0
2
6
  ------
3
7
  * Replace redirect calls to use App Bridge redirect functionality
@@ -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 App Bridge Redirect
18
- window.appBridgeRedirect(targetInfo.url);
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
- window.appBridgeRedirect(this.setNormalizedLink(storageAccessStatus));
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="<%= I18n.locale %>">
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>
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ShopifyApp
3
- VERSION = '14.1.0'
3
+ VERSION = '14.2.0'
4
4
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shopify_app",
3
- "version": "14.1.0",
3
+ "version": "14.2.0",
4
4
  "repository": "git@github.com:Shopify/shopify_app.git",
5
5
  "author": "Shopify",
6
6
  "license": "MIT",
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.1.0
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-17 00:00:00.000000000 Z
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);