originUrl() { return ( window.location.protocol + '//' + window.location.hostname + ( window.location.port ? ':' + window.location.port : '' ) ); }
function absoluteUrl(url) { if (!url) return url; const protocol = url.toLowerCase().split(':')[0]; if (['http', 'https', 'file', 'data'].indexOf(protocol) >= 0) return url; if (url.indexOf('//') === 0) { return location.protocol + url; } else if (url[0] === '/') { return `${location.protocol}//${location.host}${url}`; } else { return `${baseUrl()}/${url}`; } }
(function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();
function pageLocationOrigin() { // location.origin normally returns the protocol + domain + port (eg. https://example.com:8080) // but for file:// protocol this is browser dependant and in particular Firefox returns "null" // in this case. if (location.protocol === 'file:') { return 'file://'; } else { return location.origin; } }
// The Util Function to hack URLs of intercepted requests const getFixedUrl = (req) => { var now = Date.now() var url = new URL(req.url) // 1. fixed http URL // Just keep syncing with location.protocol // fetch(httpURL) belongs to active mixed content. // And fetch(httpRequest) is not supported yet. url.protocol = self.location.protocol // 2. add query for caching-busting. // Github Pages served with Cache-Control: max-age=600 // max-age on mutable content is error-prone, with SW life of bugs can even extend. // Until cache mode of Fetch API landed, we have to workaround cache-busting with query string. // Cache-Control-Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=453190 if (url.hostname === self.location.hostname) { url.search += (url.search ? '&' : '?') + 'cache-bust=' + now } return url.href }
name:_this.username, password:_this.pwd, }),location.protocol+"//"+location.host); setTimeout(function () { window.close();
const bumpStat = ( group, name ) => { let uriComponent = ''; if ( undefined === group ) { return; } if ( typeof group === 'object' ) { for ( const key in group ) { if ( typeof group[ key ] === 'string' ) { uriComponent += '&x_' + encodeURIComponent( key ) + '=' + encodeURIComponent( group[ key ] ); } } } else if ( typeof group === 'string' && typeof name === 'string' ) { uriComponent = '&x_' + encodeURIComponent( group ) + '=' + encodeURIComponent( name ); } if ( uriComponent.length ) { new Image().src = document.location.protocol + '//pixel.wp.com/g.gif?v=wpcom-no-pv' + uriComponent + '&baba=' + Math.random(); } }
sessionStorage.setItem("qqname",obj.nickname); sessionStorage.setItem("qqimg",obj.figureurl_qq_1); window.open(location.protocol+"//"+location.host+"/html/web/controller/register/registerqq.html")
window.addEventListener('message',function(e){ if(e.origin==location.protocol+"//"+location.host)
namespace: 'reveal-notes', type: 'connect', url: window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search, state: Reveal.getState() } ), '*' );
/** * Returns the URL for Quantcast's Purchase Confirmation Tag * * @see https://www.quantcast.com/help/guides/using-the-quantcast-asynchronous-tag/ * * @returns {string} The URL */ function quantcastAsynchronousTagURL() { const protocolAndSubdomain = document.location.protocol === 'https:' ? 'https://secure' : 'http://edge'; return protocolAndSubdomain + '.quantserve.com/quant.js'; }
function getOriginUrl() { return ( window.location.protocol + '//' + window.location.hostname + ( window.location.port ? ':' + window.location.port : '' ) ); }
(function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();
(function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();
// The Util Function to hack URLs of intercepted requests const getFixedUrl = (req) => { var now = Date.now() var url = new URL(req.url) // 1. fixed http URL // Just keep syncing with location.protocol // fetch(httpURL) belongs to active mixed content. // And fetch(httpRequest) is not supported yet. url.protocol = self.location.protocol // 2. add query for caching-busting. // Github Pages served with Cache-Control: max-age=600 // max-age on mutable content is error-prone, with SW life of bugs can even extend. // Until cache mode of Fetch API landed, we have to workaround cache-busting with query string. // Cache-Control-Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=453190 if (url.hostname === self.location.hostname) { url.search += (url.search ? '&' : '?') + 'cache-bust=' + now } return url.href }