Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

frames[0].location.href nur Schreibzugriff??

Empfohlene Antworten

Veröffentlicht

Hi,

beim Versuch die Adresse eines iframes zu ermitteln und das über methoden wie:

src = frames["INNERFRAME"].location.href;

src = frames[0].location.href;

src = frames['INNERFRAME'];

src = window.frames[0].location.href;

src = frames[0].window.location.href;
schlägt das immer fehl (Fehler-Konsole von Firefox: "uncaught exception: Die Erlaubnis für das Lesen der Eigenschaft Location.href wurde verweigert"). Aber über
frames[0].window.location.href = "http://forum.fachinformatiker.de/";

kann man ohne Probleme auf eine Site wechseln (zumindest im Firefox 2.0.0.12)

Hat jemand ne Idee, wie man die Url ermitteln kann?

Hintergrund: der User gibt was ein, z.b. "www.gmx.de" (das "http://" prefixe ich), dann wird er aber weitergeleitet auf "http://www.gmx.net/de/" und es gilt diese Adresse zu ermitteln, damit die in die Pseudo-Adressleiste eintragen kann. Ich habe alle oben angegeben Funktionen mit einem Delay von 5000ms versucht, aber keine funktioniert.

Hi!

Du kannst nicht auf den Inhalt des iframes zugreifen, wenn dieser nicht mit dem Context deines HTML-Dokuments übereinstimmt. Same origin policy - Wikipedia, the free encyclopedia

Du kannst aber auf das Element an sich zugreifen und dort den source auslesen, z.B. so:

document.getElementsByTagName("iframe")[0].src

Gruß,

JonnyTrap

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.