Browse Source

WebView: Switch back to our own User Agent builder.

pull/3202/head
TheGoddessInari 6 years ago
parent
commit
f8ba232215
No known key found for this signature in database
GPG Key ID: 1209B1B7632D69A
  1. 16
      app/ux/WebView.js

16
app/ux/WebView.js

@ -827,14 +827,14 @@ Ext.define('Hamsket.ux.WebView',{
} }
,getUserAgent() { ,getUserAgent() {
const me = this; const me = this;
// TODO: Keep just in case we need our own User Agent builder. const default_ua = `Mozilla/5.0` +
// const default_ua = `Mozilla/5.0` + ` (${me.getOSPlatform()})` +
// ` (${me.getOSPlatform()})` + ` AppleWebKit/537.36 (KHTML, like Gecko)` +
// ` AppleWebKit/537.36 (KHTML, like Gecko)` + ` Chrome/${me.getChromeVersion()} Safari/537.36`;
// ` Chrome/${me.getChromeVersion()} Safari/537.36`; // NOTE: Keep just in case we need to go back to the basics.
const default_ua = window.navigator.userAgent // const default_ua = window.navigator.userAgent
.replace(`Electron/${me.getElectronVersion()} `,'') // .replace(`Electron/${me.getElectronVersion()} `,'')
.replace(`Hamsket/${me.getAppVersion()} `, ''); // .replace(`Hamsket/${me.getAppVersion()} `, '');
const service_ua = Ext.getStore('ServicesList').getById(me.record.get('type')).get('userAgent'); const service_ua = Ext.getStore('ServicesList').getById(me.record.get('type')).get('userAgent');
const ua = service_ua ? service_ua : default_ua; const ua = service_ua ? service_ua : default_ua;
return ua; return ua;

Loading…
Cancel
Save