heavens_door 0.1.4 → 0.1.5

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: 43060fdd93e283f842f7d47848a444064ea4b691f478e056cd416e905be8e9e0
4
- data.tar.gz: cd08e3862e0dbd2b6894106e4e49eb474c577ba37cde3303e93b81ba5761dd03
3
+ metadata.gz: 11a28c86f570766975fc97869ad182ea5484a99e73e5e1bca7c5d46739f8e3a7
4
+ data.tar.gz: 0070c1f6ee6b51333edf798825aef9b3e3ea5d0db33553464c8d24e1bde918f6
5
5
  SHA512:
6
- metadata.gz: 669dc4a389cba6e280e815994404821c5d6aeb85bf28c1c305207d4a1b6b96e923b656c56da74555aa36f83048680fe912642bb13c02c04195166127bcbb063a
7
- data.tar.gz: b1052cdf547337354500098b841219bebab4bae4053ea6bc43a405eae0a401c167f9f3930df524cc0a0e02ecb72a4ffd2b9ac0dcb8fda61037924f5839bc4bd5
6
+ metadata.gz: 2e1a391b2b63e0780e653e38f4bd0230c3b6302141d4c190789da2fe3fcccc6b58582da3615c32883ac1ce8a5dbd6105425cba4495d9924440be6af3eac4ed44
7
+ data.tar.gz: d0c2a252e3e51a3fee67a304852ca8273d9c8dfbd18f42e6fe36955ff27e0357f77d72d8165d029ef8c702b0106c873220e58f633b09cdcb1ed95f0a13f48d46
@@ -24,7 +24,7 @@
24
24
  document.getElementById('heavens-door-start').style.display = 'inline';
25
25
  document.getElementById('heavens-door-stop').style.display = 'none';
26
26
  document.getElementById('heavens-door-copy').style.display = 'none';
27
- sessionStorage.clear('heavensDoor');
27
+ sessionStorage.removeItem('heavensDoor');
28
28
  });
29
29
 
30
30
  document.getElementById('heavens-door-copy').addEventListener('click', () => {
@@ -10,6 +10,7 @@ module HeavensDoor
10
10
  status, headers, body = @app.call env
11
11
 
12
12
  if headers && headers['Content-Type']&.include?('text/html') &&
13
+ (status / 100 != 3) && # redirections
13
14
  (!env['action_dispatch.content_security_policy']&.script_src('unsafe-inline') && !env['action_dispatch.content_security_policy']&.style_src('unsafe-inline')) # the Rails default top page has this
14
15
  case body
15
16
  when ActionDispatch::Response, ActionDispatch::Response::RackBody
@@ -18,6 +19,7 @@ module HeavensDoor
18
19
  body = body[0]
19
20
  end
20
21
 
22
+ body = body.dup if body.frozen?
21
23
  body.sub!(/<\/head[^>]*>/) { %Q[<link rel="stylesheet" href="/assets/heavens_door.css" /><script src="/assets/heavens_door.js"></script>\n#{$~}] }
22
24
  body.sub!(/<body[^>]*>/) { %Q[#{$~}\n<div id="heavens-door" class="heavens-door-custom"><span id="heavens-door-start">⏺</span><span id="heavens-door-stop">⏹</span><span id="heavens-door-copy">📋</span></div>] }
23
25
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HeavensDoor
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heavens_door
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akira Matsuda
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-03 00:00:00.000000000 Z
11
+ date: 2019-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler