()
| 4 | * 生成注入到Webview中的js代码 |
| 5 | */ |
| 6 | export function generateInstallPluginScript() { |
| 7 | /** |
| 8 | * manifest copy from: |
| 9 | * com.msgbyte.env.rn/manifest.json |
| 10 | */ |
| 11 | const inner = `function main() { |
| 12 | window.tailchat |
| 13 | .installPlugin({ |
| 14 | label: 'React Native Support', |
| 15 | 'label.zh-CN': 'ReactNative 支持', |
| 16 | name: 'com.msgbyte.env.rn', |
| 17 | url: '/plugins/com.msgbyte.env.rn/index.js', |
| 18 | version: '0.0.0', |
| 19 | author: 'moonrailgun', |
| 20 | description: 'Add support for ReactNative environment in Tailchat', |
| 21 | 'description.zh-CN': '在 Tailchat 添加对 ReactNative 环境的支持', |
| 22 | requireRestart: true, |
| 23 | }); |
| 24 | }`; |
| 25 | |
| 26 | const raw = `(${inner})()`; |
| 27 | return raw; |
| 28 | } |
| 29 | |
| 30 | export function generateDebugScript() { |
| 31 | const inner = `function main() { |
no outgoing calls
no test coverage detected