Zend certified PHP/Magento developer

Chrome won’t allow download of file opened via Chrome Extension’s Javascript window.open(URL)

I have a Chrome extension which offers buttons, which when clicked perform a windows.open(“url”) command. This part works fine, and I get a new tab when clicked, with the correct URL. But Chrome won’t let me download this file. When the file is from a Google drive, I get the message:

drive.google.com is blocked
drive.google.com refused to connect.
ERR_BLOCKED_BY_RESPONSE

If instead I point to a file in my github, it shows the file like normal, and it has a download button, but the download button doesn’t do anything when clicked.

But when I click my button, and in the new tab that appears, if I copy that URL and paste it into a new tab, it downloads just fine – whether it’s from the Google drive or not, whether it’s a PDF or not.

I’ve tried from Mac and Windows, and on a couple of different computers.

Chrome offers to open the file in a Connected App – when I try with “Text Editor”, it shows me the file, and has a Download button, which is active, but clicking that button still doesn’t download the file.

I have looked through a lot of Chrome security settings, but haven’t found anything which will enable download the file directly from the initial tab.

What I want is to be able to download the file that is opened in the new tab, using the browser’s normal download button.


To reproduce, add the BBOAlert extension (I am piggybacking on this one). Then go to the Bridgebase site, create a free account, and log in. On the right-hand side, click the BBOalert tab. This will bring up a blue panel. Copy this URL from my github. While this is in your clipboard, click the Data… pulldown menu from the blue panel, and select “Paste(New)”. This tells the extension to load the file from the clipboard. Now click the Shortcuts menu from the blue panel. You should see several buttons, in orange and blue. Click the blue “Play of the Hand in the 21st Century” button. This will expand more buttons. Click the NS button to the right of “Making a Plan”. This should open 2 tabs, one for a PDF and one for a .LIN file (a short text file). On the tab for the .LIN file, I get a message “No preview available”, but there’s a blue Download button. Click that button. For me, I get an error message. What I would like is for that file to be downloaded when I click that button.