@webqit/webflo 0.11.2 → 0.11.5

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.
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "vanila-javascript"
13
13
  ],
14
14
  "homepage": "https://webqit.io/tooling/webflo",
15
- "version": "0.11.2",
15
+ "version": "0.11.5",
16
16
  "license": "MIT",
17
17
  "repository": {
18
18
  "type": "git",
@@ -27,7 +27,7 @@ export default class Worker extends Dotfile {
27
27
  network_first_urls: [],
28
28
  cache_first_urls: [],
29
29
  network_only_urls: [],
30
- cache_only_urls: [ '/page-3/{*.json}' ],
30
+ cache_only_urls: [],
31
31
  skip_waiting: false,
32
32
  // -----------------
33
33
  support_push: false,
@@ -102,11 +102,7 @@ export default class Runtime {
102
102
  if (!anchor.target && !anchor.download && this.isSpaRoute(anchor, e)) {
103
103
  // Publish everything, including hash
104
104
  this.go(Url.copy(anchor), {}, { src: anchor, srcType: 'link', });
105
- // URLs with # will cause a natural navigation
106
- // even if pointing to a different page, a natural navigation will still happen
107
- // because with the Observer.set() above, window.document.location.href would have become
108
- // the destination page, which makes it look like same page navigation
109
- if (!anchor.href.includes('#')) {
105
+ if (!(_before(window.document.location.href, '#') === _before(anchor.href, '#') && anchor.href.includes('#'))) {
110
106
  e.preventDefault();
111
107
  }
112
108
  }
@@ -147,11 +143,7 @@ export default class Runtime {
147
143
  method: submitParams.method,
148
144
  body: formData,
149
145
  }, { ...submitParams, src: form, srcType: 'form', });
150
- // URLs with # will cause a natural navigation
151
- // even if pointing to a different page, a natural navigation will still happen
152
- // because with the Observer.set() above, window.document.location.href would have become
153
- // the destination page, which makes it look like same page navigation
154
- if (!actionEl.hash) {
146
+ if (!(_before(window.document.location.href, '#') === _before(actionEl.href, '#') && actionEl.href.includes('#'))) {
155
147
  e.preventDefault();
156
148
  }
157
149
  }
@@ -165,8 +157,8 @@ export default class Runtime {
165
157
 
166
158
  // -----------------------
167
159
  // Service Worker && COMM
168
- if (this.cx.service_worker_support) {
169
- let workport = new Workport(this.cx.worker_filename, { scope: this.cx.worker_scope, startMessages: true });
160
+ if (this.cx.params.service_worker_support) {
161
+ let workport = new Workport(this.cx.params.worker_filename, { scope: this.cx.params.worker_scope, startMessages: true });
170
162
  Observer.set(this, 'workport', workport);
171
163
  workport.messaging.listen(async evt => {
172
164
  let responsePort = evt.ports[0];