質問編集履歴
1
エラーの内容とクロスオリジン対応について修正・追記させていただきました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -11,7 +11,8 @@
|
|
11
11
|
> clearInterval(jsInitCheckTimer);
|
12
12
|
> const iframeElem = document.querySelectorAll('*[id^="wb"]');
|
13
13
|
> const target = iframeElem[0];
|
14
|
-
> const iframeDocument = target.document;
|
14
|
+
> ~~const iframeDocument = target.document;~~
|
15
|
+
> const iframeDocument = target.contentDocument;
|
15
16
|
> console.log(target.id);
|
16
17
|
> const observer = new MutationObserver((mutations) => {
|
17
18
|
> mutations.forEach((mutation) => {
|
@@ -27,4 +28,11 @@
|
|
27
28
|
> });
|
28
29
|
> }
|
29
30
|
> }
|
30
|
-
> }
|
31
|
+
> }
|
32
|
+
[2021/03/11追記]
|
33
|
+
上記で実行したエラーは下記になります。
|
34
|
+
Uncaught TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'. at jsLoaded (content.js:14)
|
35
|
+
|
36
|
+
暫定ですが、クロスオリジン対応としてChromeのアドオンに「Allow CORS: Access-Control-Allow-Origin」(https://chrome.google.com/webstore/detail/allow-cors-access-control/lhobafahddgcelffkeicbaginigeejlf?hl=ja)を追加したり、
|
37
|
+
下記リンクを参照させていただき起動時にオプションをつけてエラーを無視する方法をとっています。
|
38
|
+
https://webbibouroku.com/Blog/Article/cors-browser-setting
|