Я пытаюсь редактировать кросс-домен iframe. в частности, я хочу изменить текст, который появляется в кнопке сохранения диска Google.Кнопка Сохранить Google Drive Редактирование текста - Перекрестный домен iframe edit
https://developers.google.com/drive/web/savetodrive Это то, что я хочу изменить.
$(".gdrivelink iframe").contents().find(".save-to-drive-text").text('Save to Google Drive');
Эта ошибка возникает при попытке запустить код изменения текста.
DOMException {message: "Failed to read the 'contentDocument' property from…92.168.2.27" from accessing a cross-origin frame.", name: "SecurityError", code: 18, stack: "Error: Failed to read the 'contentDocument' proper…ject.InjectedScript.evaluate (<anonymous>:609:21)", INDEX_SIZE_ERR: 1…}code: 18message: "Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "xxxx://192.168.2.27" from accessing a cross-origin frame."name: "SecurityError"stack: "Error: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "192.168.2.27" from accessing a cross-origin frame.
at Error (native)
at n.each.contents (192.168.2.27/zm/js/jquery.js:2:26312)
at Function.n.extend.map (192.168.2.27/zm/js/jquery.js:2:3483)
at n.fn.(anonymous function) [as contents] (192.168.2.27/zm/js/jquery.js:2:26401)
at <anonymous>:2:25
at Object.InjectedScript._evaluateOn (<anonymous>:762:137)
at Object.InjectedScript._evaluateAndWrap (<anonymous>:695:34)
at Object.InjectedScript.evaluate (<anonymous>:609:21)"__proto__: DOMException
Я искал это, но не смог найти разрешение.
Спасибо за ваш ответ :) Я бы поднял, но я не могу, так как моя учетная запись не имеет репутации :(Я так много думал :(Я действительно надеялся, что кто-то найдет работу. что люди здесь очень хитроумны с точки зрения динамически загружаемого контента из других доменов. Скорее, тогда я не видел что-то с прямой загрузкой на страницу, а не в iframe. Первые мировые проблемы, я полагаю. :( – moeiscool