Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added patch code from parent repo #672

Open
wants to merge 43 commits into
base: master
Choose a base branch
from

Conversation

KerwinSunKami
Copy link

fix xss in redirect with url regex validation

xlc and others added 30 commits November 12, 2015 11:55
GET me/files/@{id}
PATCH me/files/@{id}
Even the online documents are using Content-Type application/json for PATCH operation, it doesn't work for file update. The parameters need to be in query string instead.
After Chrome 47, launchWebAuthFlow no longer works with a
accounts.google.com URI, so we are unable to use it to auth with Google
( https://code.google.com/p/chromium/issues/detail?id=559523 )

This adds support code for a workaround where we redirect to a
redirect.html page hosted on the web, and from there use the
chrome.runtime APIs to communicate the auth response back to the
extension.

In order to use it developers will need to host the redirect.html file
with hello.js and set that as the redirect_url for hello.js, add the
chrome_ext_id option to their extension’s ID, and add an
‘externally_connectable’ option to their manifest to authorize their
site to send messages to their extension.
We error out if we try to access the callback in the parent window due
to cross-origin security rules
When running a website as a Chrome App on recent Chrome OS versions,
the popup is launched as a separate process and cannot directly access
the opener, even though they have the same origin.

This works around that by using postMessage instead.
Hellojs opens up an iframe which redirects and communicates to the parent window using url hash
when there is a network error, redirect.html will never be loaded hence the promise can never
be rejected. Hello.js also has a recursive background timeout loop which checks for the status
of such window and from that it will resolve a promise callback stored in the window object and
remove th iframe from DOM. This loop will never detect the status at all during network error
hence the iframe is not removed from DOM.

Solution here is to add a failsafe that rejects promise and cleans up the iframe if the loop never
resolved the promise after a certain amount of time specified by the upstream login call.
Phil and others added 11 commits March 5, 2020 14:31
Add an optional callback that returns a reference to the popup
It seems that passing left and top in the options does nothing if you also pass width and height. When width and height is set, it will set left and top to position the window at the center of the screen, and ignore what's in the options. Add a condition that makes it only do that when left and top are not set in the options.

ps: using double equality '==' is not allowed
Add extra debugging when onError triggers on xhr request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants