(title)
| 16 | // under the License. |
| 17 | |
| 18 | export const setDocumentTitle = function (title) { |
| 19 | document.title = title |
| 20 | const ua = navigator.userAgent |
| 21 | // eslint-disable-next-line |
| 22 | const regex = /\bMicroMessenger\/([\d\.]+)/ |
| 23 | if (regex.test(ua) && /ip(hone|od|ad)/i.test(ua)) { |
| 24 | const i = document.createElement('iframe') |
| 25 | i.src = '/favicon.ico' |
| 26 | i.style.display = 'none' |
| 27 | i.onload = function () { |
| 28 | setTimeout(function () { |
| 29 | i.remove() |
| 30 | }, 9) |
| 31 | } |
| 32 | document.body.appendChild(i) |
| 33 | } |
| 34 | } |
no test coverage detected