<http://forums.mozillazine.org/posting.php?mode=reply&f=38&t=2821769>
The 'new' HTTPS security blockage by Firefox is causing me problems.

I have a local http://127.0.0.1/ LAMP server and a script file stored there 
that has
all of my bookmarklet scripts in it that I inject into a script object when 
I click on
one of my bookmark toolbar bookmarklets, which then also calls the 
appropriate function.
(or just calls the function if the script file has already been loaded into 
that page)

So the bookmarklets all have a small JS "standard format" interface 
routine, rather than
a huge amount of hard-to-read code in the bookmark. Some of the 
bookmarklets open
a new window and some execute in the current window. All I have to do is 
put the
function in the 'library' file and copy and paste the "standard" call 
function as a
bookmarklet and change the name of the called function.

Here are two bookmarklet examples, one that opens a new window and one that 
executes
on the current window: (where GBM_showLinkedImages and GBM_zoomInImage are 
the names
of the called functions residing in the 'library' JS file)

javascript:
(function(){
   window.GBM_Bookmarklet = 'GBM_showLinkedImages';
   GBM_Bookmarklet_Win = window.open();
   if (typeof (GBM_bLibraryLoaded) == 'undefined') {
      var oScript = document.createElement ('script');
      oScript.onload = function(){
         window[window.GBM_Bookmarklet]();
      };
      oScript.type = 'text/javascript';
      oScript.src = 'http://127.0.0.1/location/GBM_library.js?' + 
Math.floor (Math.random() * 99999);
      document.getElementsByTagName ('head')[0].appendChild (oScript);
   } else {
      window[window.GBM_Bookmarklet]();
   }
})()

javascript:
(function(){
   window.GBM_Bookmarklet = 'GBM_zoomInImage';
   if (typeof (GBM_bLibraryLoaded) == 'undefined') {
      var oScript = document.createElement ('script');
      oScript.onload = function(){
         window[window.GBM_Bookmarklet]();
      };
      oScript.type = 'text/javascript';
      oScript.src = 'http://127.0.0.1/location/GBM_library.js?' + 
Math.floor (Math.random() * 99999);
      document.getElementsByTagName ('head')[0].appendChild (oScript);
   } else {
      window[window.GBM_Bookmarklet]();
   }
})()
HTTPS prevents that from happening now. (like if I try to execute one of my 
bookmarklets on a FACEBOOK page)

I get a "content security policy" error with "the page's settings blocked 
the loading of a resource" message,
because it doesn't like "HTTP://127.0.0.1/". (because it's not HTTPS:, like 
FACEBOOK)

I suppose I could get a local HTTPS certificate, but that is (seems like) a 
lot of work and
knowledge steep learning curve.

Or maybe use Greasemonkey to inject the script instead. But communicating 
between
Gm and the bookmarklet is sometimes problematic. And I might just get the 
same error or
something similar. I know Gm has a bunch of 'new' features and 
functionality these days
that I haven't kept up with.

I'm looking for a "simple (easy) solution".

 

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/greasemonkey-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to