mobile-detect.js 529 B

12345678910111213141516
  1. (function(win) {
  2. var orgLink = win.location.href
  3. var newLink = ''
  4. if (/iPhone|iPad|Android/i.test(win.navigator.userAgent)) {
  5. if (orgLink.indexOf('smart-viewer.html') !== -1) {
  6. newLink = orgLink.replace('smart-viewer.html', 'smart-sviewer.html')
  7. }
  8. } else {
  9. if (orgLink.indexOf('smart-sviewer.html') !== -1) {
  10. newLink = orgLink.replace('smart-sviewer.html', 'smart-viewer.html')
  11. }
  12. }
  13. if (newLink) {
  14. win.location.href = newLink
  15. }
  16. }(window))