(resultFactory)
| 835 | linkTabContents(tab) |
| 836 | |
| 837 | function replaceContent(resultFactory) { |
| 838 | if (resultFactory === undefined || resultFactory === null) { |
| 839 | return |
| 840 | } |
| 841 | const result = typeof resultFactory === "function" ? resultFactory() : resultFactory |
| 842 | if (result instanceof Promise) { |
| 843 | result.then(replaceContent) |
| 844 | } else if (result instanceof Node) { |
| 845 | wrapper.replaceChildren(result) |
| 846 | } else { |
| 847 | wrapper.innerHTML = result |
| 848 | } |
| 849 | } |
| 850 | |
| 851 | replaceContent(request.content) |
| 852 |