Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating a bookmarklet that doesn't get blocked
    primarykey
    data
    text
    <p><strong>Goal:</strong> To create a bookmarklet that calls a remote javascript file that opens a popup window. The popup window is functionally similar to what Delicious's bookmarklet does.</p> <p><strong>Background:</strong> Currently, I'm using window.open within this javascript file, however the popup is getting blocked by pretty much every major browser. </p> <p>The alternative solution to this is very similar to the way Delicious wrote their bookmarklet - calling window.open through a javascript query within the bookmarklet itself. However, I need the ability to modify the other contents of my javascript file in the future without requiring users to continually grab newest releases of the bookmarklet.</p> <p><strong>What I've determined to be happening:</strong> Since the window.open call is not occurring <em>directly</em> as a result of a click by the user, the browser feels this is something that should be blocked. Here's <a href="http://msdn.microsoft.com/en-us/library/ms537632(VS.85).aspx" rel="nofollow noreferrer">a source</a> on this.</p> <p><a href="http://www.smashingmagazine.com/2010/05/23/make-your-own-bookmarklets-with-jquery/" rel="nofollow noreferrer">This</a> is the tutorial I referenced most recently in creating the call to the remote js file.</p> <p>Here is a basic example of what my code is doing; the window.open/popup portion is the only significant part I'm including as it's the only part I feel is causing the complication:</p> <p>Example of the remote javascript file:</p> <pre><code>if (typeof jQuery == 'undefined') { var jQ = document.createElement('script'); jQ.type = 'text/javascript'; jQ.onload=runthis; jQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'; document.body.appendChild(jQ); } else { runthis(); } function runthis() { window.open('http://www.google.com/', 'a title', 'location=yes,links=no,scrollbars=no,toolbar=no,width=550,height=550'); } </code></pre> <p>I'd really appreciate any help as this has been stumping me for a while!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload