Details
-
Bug
-
Resolution: Fixed
-
Medium
Description
If you open OAuth authorize url (example) within self-hosted WebBrowser control on windows (eg. .NET) you get javscript error:
javascript error at https://d3oaxc4q5k2d6q.cloudfront.net/m/3d70c2b99510/dist/main.js
Sample PowerShell code:
$authorizeUri = "https://bitbucket.org/site/oauth2/authorize?client_id=hmepwfg9wqvXypWYAW&response_type=code" Add-Type -AssemblyName System.Windows.Forms $OnDocumentCompleted = { if($web.Url.AbsoluteUri -match "code=([^&]*)") { $script:AuthCode = $Matches[1] $form.Close() } elseif($web.Url.AbsoluteUri -match "error=") { $form.Close() } } $web = New-Object System.Windows.Forms.WebBrowser -Property [~legacy-bitbucket-user] $web.Add_DocumentCompleted($OnDocumentCompleted) $form = New-Object System.Windows.Forms.Form -Property [~legacy-bitbucket-user] $form.Add_Shown({$form.Activate()}) $form.Controls.Add($web) $web.Dock = "Fill" # Request Authorization Code $web.Navigate($authorizeUri) $null = $form.ShowDialog()