Closed mechiland closed 12 years ago
In JavaScript you can access the location
object. If you want the url use location.href
.
when the page is not yours, there is no way to to inject javascript to the page.
On Wed, Feb 29, 2012 at 8:20 AM, Liam Kaufman reply@reply.github.com wrote:
In JavaScript you can access the
location
object. If you want the url uselocation.href
.
Reply to this email directly or view it on GitHub: https://github.com/maccman/macgap/issues/34#issuecomment-4238131
Blog: http://michael.nona.name GTalk/Twitter/Facebook/Yahoo/Skype: mechiland
I think document.referrer
will get you the url of the previous page.
Hmm...the problem is...You own neither of them. Let me make the process clearer, as of twitter OAuth example:
I had figured out a way to get the URL though it's nasty...by exposing the URL via some code like "[self.windowController.contentView.webView mainFrameURL]"
On Wed, Feb 29, 2012 at 10:37 AM, Liam Kaufman reply@reply.github.com wrote:
I think
document.referrer
will get you the url of the previous page.
Reply to this email directly or view it on GitHub: https://github.com/maccman/macgap/issues/34#issuecomment-4241108
Blog: http://michael.nona.name GTalk/Twitter/Facebook/Yahoo/Skype: mechiland
@mechiland Did you ever find a way to do this reliably?
@eliasisrael Just thought I'd check that you definitely mean to be in the MacGap 1 issue queue? MacGap 2 is a complete rewrite and no further development is planned for v1.
Good call, @jeff-h ; you're right that I'm trying to get this figured out for MacGap2.
So like most of the OAuth 2.0 links, like this:
window.open("target-oauth-2.0-url")
// You authorize it // OAuth server will redirect with special sort of "accee token" // The webview browser will actually redirect to "your-callback-url?#access_code=newly_created"
Then how do we get the url so that we can parse the access_code for later use?