After the webapp is encapsulated, how can it be inaccessible to the computer end and the WeChat end of the mobile phone? Can only be accessed within app. Can you do that?

after the webapp is encapsulated, how to make it inaccessible to the computer and WeChat end of the phone? It can only be accessed within app. Can you do that?

Oct.19,2021

can judge user-agent .

by app, do you mean your specific app or all app?

if it is a specific app, you can process it by judging the user-agent of webview in app.

exclude Wechat

function isWechat() {
  return (/micromessenger/i).test(window.navigator.userAgent);
}
Menu