Chrome 插件 launchWebAuthFlow 在 Pinterest 中崩溃
Chrome plugin launchWebAuthFlow crashes with Pinterest
我正在开发一个 Chrome 扩展程序,它正在从 Pinterest 读取一些数据(分享数量)。我不得不停止对它的开发,但它工作正常(我能够检索共享号和所有)。
现在我的客户再次需要这个,我重新开始工作,但我真的傻眼了,因为应用程序现在在调用 launchWebAuthFlow
方法时崩溃 Chrome。
我能够通过 Dropbox 和其他 OAuth 提供商启动这种流程。出于某种原因,当使用 Pinterest 时,整个 Chrome 过程严重崩溃。
授权代码如下所示(*为了便于阅读,我内联了一些变量):
var redirectUri = chrome.identity.getRedirectURL("pinterest");
var authUrl = 'https://api.pinterest.com/oauth/?' +
'response_type=code'+
'&redirect_uri='+ encodeURIComponent(redirectUri) +
'&client_id=4831470687770133014'+
'&scope=read_public'+
'&state=somethingRandom';
chrome.identity.launchWebAuthFlow(
{'url': authUrl, 'interactive': true},
function(redirect_url) { console.log(redirect_url);}
);
authUrl 看起来像这样:
https://api.pinterest.com/oauth/?response_type=code&redirect_uri=https://bkjcojjjcgnfgncncmdlbeemoljomghm.chromiumapp.org/pinterest&client_id=4831470687770133014&scope=read_public&state=3875186
如果您在浏览器中 copy/paste 这个 URL,您会发现它有效。但是当使用了一部分launchWebAuthFlow
,BOOM!
为什么?
规格:
Chrome:53.0.2785.143
Mac OS: El Captain 10.11.6
这是 Mac OS 崩溃报告:
Process: Google Chrome [16077]
Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Identifier: com.google.Chrome
Version: 53.0.2785.143 (2785.143)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Google Chrome [16077]
User ID: 501
Date/Time: 2016-10-03 21:09:38.740 -0400
OS Version: Mac OS X 10.11.6 (15G31)
Report Version: 11
Anonymous UUID: AD141569-EBED-B1D4-DF7D-27A6CE685215
Sleep/Wake UUID: 8917F66A-5515-40E1-AA86-8BE0BE1DC1A9
Time Awake Since Boot: 14000 seconds
Time Since Wake: 1600 seconds
System Integrity Protection: enabled
Crashed Thread: 0 CrBrowserMain Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000000001e8
VM Regions Near 0x1e8:
-->
__TEXT 00000001051ac000-00000001051ad000 [ 4K] r-x/rwx SM=COW /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread
0 com.google.Chrome.framework 0x0000000109d656d2 0x105413000 + 76883666
1 com.google.Chrome.framework 0x0000000109d655c9 0x105413000 + 76883401
2 com.google.Chrome.framework 0x00000001055a42f6 0x105413000 + 1643254
3 com.google.Chrome.framework 0x00000001054c0201 0x105413000 + 709121
4 com.google.Chrome.framework 0x00000001054c03b7 0x105413000 + 709559
5 com.google.Chrome.framework 0x0000000106e3cc29 0x105413000 + 27434025
6 com.google.Chrome.framework 0x0000000106e467f7 0x105413000 + 27473911
7 com.google.Chrome.framework 0x000000010693a148 0x105413000 + 22180168
8 com.google.Chrome.framework 0x0000000106939889 0x105413000 + 22177929
9 com.google.Chrome.framework 0x0000000106e46ad7 0x105413000 + 27474647
10 com.google.Chrome.framework 0x0000000106933a8e 0x105413000 + 22153870
11 com.google.Chrome.framework 0x00000001069315ea 0x105413000 + 22144490
12 com.google.Chrome.framework 0x00000001069318e4 0x105413000 + 22145252
13 com.google.Chrome.framework 0x000000010693ed33 0x105413000 + 22199603
14 com.google.Chrome.framework 0x00000001059a201b 0x105413000 + 5828635
15 com.google.Chrome.framework 0x00000001059c47ac 0x105413000 + 5969836
16 com.google.Chrome.framework 0x00000001059c4abc 0x105413000 + 5970620
17 com.google.Chrome.framework 0x00000001059c4e1b 0x105413000 + 5971483
18 com.google.Chrome.framework 0x000000010599731d 0x105413000 + 5784349
19 com.google.Chrome.framework 0x00000001059ba71a 0x105413000 + 5928730
20 com.google.Chrome.framework 0x0000000105996d24 0x105413000 + 5782820
21 com.apple.CoreFoundation 0x00007fff98059881 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
22 com.apple.CoreFoundation 0x00007fff98038fbc __CFRunLoopDoSources0 + 556
23 com.apple.CoreFoundation 0x00007fff980384df __CFRunLoopRun + 927
24 com.apple.CoreFoundation 0x00007fff98037ed8 CFRunLoopRunSpecific + 296
25 com.apple.HIToolbox 0x00007fff909fb935 RunCurrentEventLoopInMode + 235
26 com.apple.HIToolbox 0x00007fff909fb76f ReceiveNextEventCommon + 432
27 com.apple.HIToolbox 0x00007fff909fb5af _BlockUntilNextEventMatchingListInModeWithFilter + 71
28 com.apple.AppKit 0x00007fff8f014df6 _DPSNextEvent + 1067
29 com.apple.AppKit 0x00007fff8f014226 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
30 com.apple.AppKit 0x00007fff8f008d80 -[NSApplication run] + 682
31 com.google.Chrome.framework 0x0000000105997b4e 0x105413000 + 5786446
32 com.google.Chrome.framework 0x0000000105997174 0x105413000 + 5783924
33 com.google.Chrome.framework 0x00000001059dc811 0x105413000 + 6068241
34 com.google.Chrome.framework 0x00000001054b6ce5 0x105413000 + 670949
35 com.google.Chrome.framework 0x0000000108efc984 0x105413000 + 61774212
36 com.google.Chrome.framework 0x0000000108efee02 0x105413000 + 61783554
37 com.google.Chrome.framework 0x0000000108ef8f2d 0x105413000 + 61759277
38 com.google.Chrome.framework 0x0000000105953c90 0x105413000 + 5508240
39 com.google.Chrome.framework 0x0000000105952ed6 0x105413000 + 5504726
40 com.google.Chrome.framework 0x0000000105415aea ChromeMain + 58
41 com.google.Chrome 0x00000001051acd42 main + 530
42 com.google.Chrome 0x00000001051acb24 0x1051ac000 + 2852
etc....
在提出这个问题大约一个月后对 Chrome 的更新解决了这个问题。
我正在开发一个 Chrome 扩展程序,它正在从 Pinterest 读取一些数据(分享数量)。我不得不停止对它的开发,但它工作正常(我能够检索共享号和所有)。
现在我的客户再次需要这个,我重新开始工作,但我真的傻眼了,因为应用程序现在在调用 launchWebAuthFlow
方法时崩溃 Chrome。
我能够通过 Dropbox 和其他 OAuth 提供商启动这种流程。出于某种原因,当使用 Pinterest 时,整个 Chrome 过程严重崩溃。
授权代码如下所示(*为了便于阅读,我内联了一些变量):
var redirectUri = chrome.identity.getRedirectURL("pinterest");
var authUrl = 'https://api.pinterest.com/oauth/?' +
'response_type=code'+
'&redirect_uri='+ encodeURIComponent(redirectUri) +
'&client_id=4831470687770133014'+
'&scope=read_public'+
'&state=somethingRandom';
chrome.identity.launchWebAuthFlow(
{'url': authUrl, 'interactive': true},
function(redirect_url) { console.log(redirect_url);}
);
authUrl 看起来像这样:
https://api.pinterest.com/oauth/?response_type=code&redirect_uri=https://bkjcojjjcgnfgncncmdlbeemoljomghm.chromiumapp.org/pinterest&client_id=4831470687770133014&scope=read_public&state=3875186
如果您在浏览器中 copy/paste 这个 URL,您会发现它有效。但是当使用了一部分launchWebAuthFlow
,BOOM!
为什么?
规格: Chrome:53.0.2785.143 Mac OS: El Captain 10.11.6
这是 Mac OS 崩溃报告:
Process: Google Chrome [16077]
Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Identifier: com.google.Chrome
Version: 53.0.2785.143 (2785.143)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Google Chrome [16077]
User ID: 501
Date/Time: 2016-10-03 21:09:38.740 -0400
OS Version: Mac OS X 10.11.6 (15G31)
Report Version: 11
Anonymous UUID: AD141569-EBED-B1D4-DF7D-27A6CE685215
Sleep/Wake UUID: 8917F66A-5515-40E1-AA86-8BE0BE1DC1A9
Time Awake Since Boot: 14000 seconds
Time Since Wake: 1600 seconds
System Integrity Protection: enabled
Crashed Thread: 0 CrBrowserMain Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000000001e8
VM Regions Near 0x1e8:
-->
__TEXT 00000001051ac000-00000001051ad000 [ 4K] r-x/rwx SM=COW /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread
0 com.google.Chrome.framework 0x0000000109d656d2 0x105413000 + 76883666
1 com.google.Chrome.framework 0x0000000109d655c9 0x105413000 + 76883401
2 com.google.Chrome.framework 0x00000001055a42f6 0x105413000 + 1643254
3 com.google.Chrome.framework 0x00000001054c0201 0x105413000 + 709121
4 com.google.Chrome.framework 0x00000001054c03b7 0x105413000 + 709559
5 com.google.Chrome.framework 0x0000000106e3cc29 0x105413000 + 27434025
6 com.google.Chrome.framework 0x0000000106e467f7 0x105413000 + 27473911
7 com.google.Chrome.framework 0x000000010693a148 0x105413000 + 22180168
8 com.google.Chrome.framework 0x0000000106939889 0x105413000 + 22177929
9 com.google.Chrome.framework 0x0000000106e46ad7 0x105413000 + 27474647
10 com.google.Chrome.framework 0x0000000106933a8e 0x105413000 + 22153870
11 com.google.Chrome.framework 0x00000001069315ea 0x105413000 + 22144490
12 com.google.Chrome.framework 0x00000001069318e4 0x105413000 + 22145252
13 com.google.Chrome.framework 0x000000010693ed33 0x105413000 + 22199603
14 com.google.Chrome.framework 0x00000001059a201b 0x105413000 + 5828635
15 com.google.Chrome.framework 0x00000001059c47ac 0x105413000 + 5969836
16 com.google.Chrome.framework 0x00000001059c4abc 0x105413000 + 5970620
17 com.google.Chrome.framework 0x00000001059c4e1b 0x105413000 + 5971483
18 com.google.Chrome.framework 0x000000010599731d 0x105413000 + 5784349
19 com.google.Chrome.framework 0x00000001059ba71a 0x105413000 + 5928730
20 com.google.Chrome.framework 0x0000000105996d24 0x105413000 + 5782820
21 com.apple.CoreFoundation 0x00007fff98059881 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
22 com.apple.CoreFoundation 0x00007fff98038fbc __CFRunLoopDoSources0 + 556
23 com.apple.CoreFoundation 0x00007fff980384df __CFRunLoopRun + 927
24 com.apple.CoreFoundation 0x00007fff98037ed8 CFRunLoopRunSpecific + 296
25 com.apple.HIToolbox 0x00007fff909fb935 RunCurrentEventLoopInMode + 235
26 com.apple.HIToolbox 0x00007fff909fb76f ReceiveNextEventCommon + 432
27 com.apple.HIToolbox 0x00007fff909fb5af _BlockUntilNextEventMatchingListInModeWithFilter + 71
28 com.apple.AppKit 0x00007fff8f014df6 _DPSNextEvent + 1067
29 com.apple.AppKit 0x00007fff8f014226 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
30 com.apple.AppKit 0x00007fff8f008d80 -[NSApplication run] + 682
31 com.google.Chrome.framework 0x0000000105997b4e 0x105413000 + 5786446
32 com.google.Chrome.framework 0x0000000105997174 0x105413000 + 5783924
33 com.google.Chrome.framework 0x00000001059dc811 0x105413000 + 6068241
34 com.google.Chrome.framework 0x00000001054b6ce5 0x105413000 + 670949
35 com.google.Chrome.framework 0x0000000108efc984 0x105413000 + 61774212
36 com.google.Chrome.framework 0x0000000108efee02 0x105413000 + 61783554
37 com.google.Chrome.framework 0x0000000108ef8f2d 0x105413000 + 61759277
38 com.google.Chrome.framework 0x0000000105953c90 0x105413000 + 5508240
39 com.google.Chrome.framework 0x0000000105952ed6 0x105413000 + 5504726
40 com.google.Chrome.framework 0x0000000105415aea ChromeMain + 58
41 com.google.Chrome 0x00000001051acd42 main + 530
42 com.google.Chrome 0x00000001051acb24 0x1051ac000 + 2852
etc....
在提出这个问题大约一个月后对 Chrome 的更新解决了这个问题。