Application with privileges for Firefox OS: permission to access the document object of a new window object

In my preferred Firefox OS application, I need authentication with Google.

uri=https://accounts.google.com/o/oauth2/auth............ var googleWin = window.open(uri, 'auth_window', 'fullscreen=0,width=200,height=100,resizable=1'); console.log(googleWin.document.title); 

The above statement, which is trying to print the document title, results in an error

 Error: Permission denied to access property 'document' 

I need to access the "auth" Google code from the name of the document.

How to solve the permission problem?

Thanks in advance.

+1
source share
2 answers

You cannot directly access window components. But you can write a javascript function inside a child auth_window that can easily access each dom element and perform any operations you need or return values. Then, from your parent window, just call these javascript functions:

 console.log(googleWin.getDocumentTitle()); 
+1
source
+1
source

Source: https://habr.com/ru/post/1482850/


All Articles