* 触发 window 的 storage 事件
(key, newValue, oldValue, force)
| 11 | * 触发 window 的 storage 事件 |
| 12 | */ |
| 13 | $_triggerStorage(key, newValue, oldValue, force) { |
| 14 | if (!force && newValue === oldValue) return |
| 15 | |
| 16 | const currentWindow = cache.getWindow(this.$_pageId) |
| 17 | const windowList = cache.getWindowList() || [] |
| 18 | windowList.forEach(window => { |
| 19 | if (window && window !== currentWindow) { |
| 20 | window.$$trigger('storage', { |
| 21 | event: new Event({ |
| 22 | name: 'storage', |
| 23 | target: window, |
| 24 | $$extra: { |
| 25 | key, |
| 26 | newValue, |
| 27 | oldValue, |
| 28 | storageArea: this, |
| 29 | url: currentWindow.location.href, |
| 30 | } |
| 31 | }) |
| 32 | }) |
| 33 | } |
| 34 | }) |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * 对外属性和方法 |
no test coverage detected