10 examples of 'window parent location href' in JavaScript

Every line of 'window parent location href' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
231function after_setWindowLocation(win, url) {
232 goog.dom.safe.setLocationHref(win.location, url);
233}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

389set location(href) {
390 this.$_location.href = href
391}
155updateLocation(window, url) {
156 if (window === this.current)
157 this.current.url = url;
158 window.document._URL = url;
159 window.document._location = new Location(this, url);
160}
182function createHref(location) {
183 return createPath(location);
184}
209export function provideLocationHref() {
210 return window && window.location.href;
211}
600setWindowLocationUrl: function setWindowLocationUrl (url) {
601 var windowLocation = this._windowLocation || window.location; // Allow stubbing for unit testing
602
603 // Prefer assign(), but some devices don't have this function.
604 if (typeof windowLocation.assign === 'function') {
605 windowLocation.assign(url);
606 } else {
607 windowLocation.href = url;
608 }
609},
43getBaseHrefFromDOM(): string { return getDOM().getBaseHref(this._doc); }
76function createHref(location) {
77 return history.createHref(resolveLocation(location));
78}
554reload() {
555 const window = cache.getWindow(this.$_pageId);
556 let param = ['type=jump', `targeturl=${encodeURIComponent(this.href)}`];
557 if (this.$_search) param.push(`search=${encodeURIComponent(this.$_search)}`);
558 if (this.$_hash) param.push(`hash=${encodeURIComponent(this.$_hash)}`);
559
560 param = '?' + param.join('&');
561
562 const callMethod = window.$$miniprogram.isTabBarPage(this.$_pageRoute) ? 'switchTab' : 'redirectTo';
563 API[callMethod][this.$_target]({
564 url: `${this.$_pageRoute}${param}`,
565 });
566}
151navigating (url) {
152 // console.log('CDP navigate', url)
153 this.client.Page.navigate({url}); // Note: workaround for https://github.com/cyrus-and/chrome-remote-interface/issues/324
154 return this.client.Page.navigate({url});
155}

Related snippets