Thanks. That USED to be true. I should have been more clear. I have a "local" (server - LAMP) library I want to include in ALL pages. (ideally, only when needed, when I click on a bookmarklet) The library is located at http://127.0.0.1/.... This used to always work. But now (due to some browser 'security fixes'), SOME https:// websites give an error if you try to add a script object that points to somewhere that is not "secure". Like facebook, twitter, and even google, just to name a few. So I believe that attempting to do as you say will generate a security error. I haven't tried it. I will. But I will be surprised if it works. That is the problem I've been having trying to do it as a bookmarklet. Unless Greasemonkey somehow overrides this security check.
On Thursday, December 4, 2014 3:19:13 PM UTC-8, Klaus Johannes Rusch wrote: > > On 2014-12-04 23:54, 'Dave Land' via greasemonkey-users wrote: > > On Dec 3, 2014, at 9:18 PM, GmUser <[email protected] <javascript:>> > wrote: > > Is there ANY WAY to load a javascript library using Greasemonkey and > have the functions executable by a bookmarklet? > > You can load the script in the page context to give bookmarklets > access, e.g. > > // @include http://* > // @include https://* > > (function () { > j = document.createElement("SCRIPT"); > j.src = "//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"; > document.getElementsByTagName("HEAD")[0].appendChild(j); > })(); > > -- > Klaus Johannes [email protected] > <javascript:>http://klausrusch.atmedia.net/ > > -- 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.
