Chrome插件launchWebAuthFlow与Pinterest崩溃

时间:2016-10-16 18:35:51

标签: google-chrome google-chrome-extension oauth crash pinterest

我正在开发一个从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);} ); 方法时,应用程序现在崩溃Chrome。

我能够使用Dropbox和其他OAuth提供商启动此类流程。出于某种原因,当使用Pinterest时,整个Chrome进程都会崩溃。

auth代码看起来像这样(*我为了便于阅读而内联了一些变量):

https://api.pinterest.com/oauth/?response_type=code&redirect_uri=https://bkjcojjjcgnfgncncmdlbeemoljomghm.chromiumapp.org/pinterest&client_id=4831470687770133014&scope=read_public&state=3875186

authUrl看起来像这样:

launchWebAuthFlow

如果您在浏览器中复制/粘贴此网址,则会发现它有效。但是当使用部分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.... 时,BOOM!

为什么?

规格: Chrome:53.0.2785.143 Mac OS:El Captain 10.11.6

这是Mac OS崩溃报告:

 private void writetoExcel() {
        XSSFWorkbook wb = new XSSFWorkbook(); //Create Blank workbook
        XSSFSheet ws = wb.createSheet("Patients");      //Create a blank spreadsheet with Patients name for spreadsheet

        TreeMap<String, Object[]> data = new TreeMap<>();
        data.put("-1", new Object[]{ds.getColumnName(1), ds.getColumnName(2), ds.getColumnName(3), ds.getColumnName(4), ds.getColumnName(5), ds.getColumnName(6), ds.getColumnName(7), ds.getColumnName(8), ds.getColumnName(9)});

        for (int i = 0; i < ds.getRowCount(); i++) {
            data.put(Integer.toString(i), new Object[]{getCellValue(i, 0), getCellValue(i, 1), getCellValue(i, 2), getCellValue(i, 3), getCellValue(i, 4), getCellValue(i, 5), getCellValue(i, 6), getCellValue(i, 7)});
        }
        Set<String> ids = data.keySet();
        XSSFRow row;
        int rowID = 0;
        for (String key : ids) {
            row = ws.createRow(rowID++);
            Object[] values = data.get(key);
            int cellID = 0;

            for (Object o : values) {
                Cell cell = row.createCell(cellID++);
                cell.setCellValue(o.toString());
            }
        }
        try {
            FileOutputStream fos = new FileOutputStream(new File("C:\\xampp\\test1.xslx"));
            wb.write(fos);
            fos.close();
        } catch (Exception e) {
            System.out.println(e);
        }
    }


 private String getCellValue(int x, int y) {
        return ds.getValueAt(x, y).toString();

    }

1 个答案:

答案 0 :(得分:0)

询问此问题大约一个月后,对Chrome进行了更新。