I have created a custom module that opens up a page in the admin overlay. Upon going to that page, a PDF is generated and the link to the file is displayed on the page. I created the link using l(), and gave the link a target attribute of '_blank' to open in a new tab/window.

l('Click here to download your PDF file.', $f_url, array('attributes' => array('target' => '_blank')))

The link looks like it is generated correctly.

<a href="http://xxxx.com/sites/default/files/custom-pdf/xxxx_4.pdf" target="_blank">Click here to download your PDF file.</a>

When I click on it, it opens in a new window, but somehow the overlay fragment is tacked onto the end of the URL in the new window address bar, which appears as the following: http://xxxx.com/sites/default/files/custom-pdf/xxxx_4.pdf#overlay-context=test.html.

The browser throws up a dialog box with a title of "Adobe PDF Document" and a message alert of "This operation is not allowed".

If I click this link from a non overlay page, it does exactly what it's supposed to do: Open the PDF in a new window.

I'm not exactly sure what's going on here.

How is the overlay fragment being appended to the URL, and how can I prevent it?

1 Answer 1


I was having the same issue.

There is a patch here.

  • Thanks for the pointer! Since the feature I was working on had to get done right away, I had to actually code to avoid this situation, which was far from ideal. I'm glad to know there is a fix for when this comes up in the future as I'm sure it will.
    – demarts
    Sep 22, 2012 at 4:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.