If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Greasemonkey does its stuff a bit too late. Can it be changed ?
Hello All,
I'm using GreaseMonkey v1.10* on FireFox to clean up some webpages, and recently found that even though I had a page scrubbed into (almost) nothingness there where still requests going out for some resources. (don't worry, they got blocked by RequestPolicy - which is also how I knew wthe requests where being done in the first place :-) ) When I looked at the pages source I found out that the related control was an iframe. Checking on other pages I found the same behaviour: even when I would scrub all iframes the requests for its data would still go out. As such I get the idea that greasemonkey kicks in just a bit too late ... tl;dr: (How) Can I get greasemonkey to start an an earlier point / (how) can I move FireFoxes retrieval of iframe (and other?) contents to a later moment. Regards, Rudy Wieser |
Ads |
#2
|
|||
|
|||
Greasemonkey does its stuff a bit too late. Can it be changed?
R.Wieser wrote:
Hello All, I'm using GreaseMonkey v1.10* on FireFox to clean up some webpages, and recently found that even though I had a page scrubbed into (almost) nothingness there where still requests going out for some resources. (don't worry, they got blocked by RequestPolicy - which is also how I knew wthe requests where being done in the first place :-) ) When I looked at the pages source I found out that the related control was an iframe. Checking on other pages I found the same behaviour: even when I would scrub all iframes the requests for its data would still go out. As such I get the idea that greasemonkey kicks in just a bit too late ... tl;dr: (How) Can I get greasemonkey to start an an earlier point / (how) can I move FireFoxes retrieval of iframe (and other?) contents to a later moment. Regards, Rudy Wieser There's a web site. http://commons.oreilly.com/wiki/inde...etting_Started http://commons.oreilly.com/wiki/inde...Hacks/Web_Mail "One last thing worth mentioning: this script intentionally delays its own processing of the page to take place after the page is loaded, by hooking into the window onload event." So the tool does seem to support a temporal approach, but is it enough ? This would really be a topic for some forum, where a concentration of web developers with *monkey credentials hang out. Paul |
#3
|
|||
|
|||
Greasemonkey does its stuff a bit too late. Can it be changed ?
Hello Paul,
There's a web site. Thanks. I've just taken a quick peek at both. [Snip] So the tool does seem to support a temporal approach, but is it enough ? Alas, that solution goes the wrong way: I need my script to be executed *earlier* (just after loading and parsing, but before acting on the parsed content). I could imagine some setting by the @xxxx entries in the header ... This would really be a topic for some forum, True. The problem is, which one ? The fora I've googled seem to be about creating scripts (not techinal questions like mine is), and are not open to a one-off guest (like I think I will be). Regards, Rudy Wieser |
#4
|
|||
|
|||
Greasemonkey does its stuff a bit too late. Can it be changed ?
On Sun, 3 Dec 2017 11:58:55 +0100, R.Wieser wrote:
Hello Paul, There's a web site. Thanks. I've just taken a quick peek at both. [Snip] So the tool does seem to support a temporal approach, but is it enough ? Alas, that solution goes the wrong way: I need my script to be executed *earlier* (just after loading and parsing, but before acting on the parsed content). I could imagine some setting by the @xxxx entries in the header ... This would really be a topic for some forum, True. The problem is, which one ? The fora I've googled seem to be about creating scripts (not techinal questions like mine is), and are not open to a one-off guest (like I think I will be). Regards, Rudy Wieser It's not possible to prevent a resource of an IFRAME from being loaded using GM script. With Firefox and GM script, only external scripts are able to be prevented from being loaded. All other external resources which are specified in a HTML document, e.g. anything pointed by an IFRAME, external CSS, WebFonts; Firefox provides a way to prevent them from being loaded, but only from a browser extension context, not from a GM script context. It's similar like what uBlock Origin or uMatrix do. i.e. it'll require browser extension API (e.g. XPCOM, XUL, WebExtension). Greasemonkey (the addon) doesn't expose that to GM scripts - although you can modify the addon to add some kind of a wrapper for the browser extension API. |
#5
|
|||
|
|||
Greasemonkey does its stuff a bit too late. Can it be changed ?
JJ,
It's not possible to prevent a resource of an IFRAME from being loaded using GM script. I'm not trying to prevent it from loading, I'm removing the iframe itself, as I have no need for its contents. .... but which you could refer to as a kind of prevention too I guess. :-) The problem is that GreaseMonkeys scripted changes are applied only after FireFox has already decided to download the iframes contents. And thats a bit different from how, for instance, an IMG element is handled: When you remove it the resource it pointed to will not be downloaded (if I may believe RequestPolicy). Regards, Rudy Wieser |
#6
|
|||
|
|||
Greasemonkey does its stuff a bit too late. Can it be changed ?
On 03/12/2017 19:23, R.Wieser wrote:
JJ, It's not possible to prevent a resource of an IFRAME from being loaded using GM script. I'm not trying to prevent it from loading, I'm removing the iframe itself, as I have no need for its contents. How much do you know about userChrome.css? If you know something about it then this code will block iframe in FF: iframe { display: none; } Good luck. -- With over 600 million devices now running Windows 10, customer satisfaction is higher than any previous version of windows. |
#7
|
|||
|
|||
Greasemonkey does its stuff a bit too late. Can it be changed ?
Good Guy,
How much do you know about userChrome.css? Currently ? Other than that it exist, none (I think). But that can, even if I have to use Google for it, change rather quickly. :-) If you know something about it then this code will block iframe in FF: iframe { display: none; } Thank you. Hmmm ... I've always wonderd about that "display:none": Does it just suppress *displaying* the element, or does it actually fully ignore the element ? I still do not know. But there is a small problem with such a solution: its an all-or-nothing one, where I would like to be able to remove *selected* iframes. For instance, I do not have facebook, and have no wish for them to plaster their content on every site I visit. Regards, Rudy Wieser |
#8
|
|||
|
|||
Greasemonkey does its stuff a bit too late. Can it be changed ?
In message , R.Wieser
writes: [] If you know something about it then this code will block iframe in FF: iframe { display: none; } Thank you. Hmmm ... I've always wonderd about that "display:none": Does it just suppress *displaying* the element, or does it actually fully ignore the element ? I still do not know. (Good question.) But there is a small problem with such a solution: its an all-or-nothing one, where I would like to be able to remove *selected* iframes. For [] Agreed: I found, when I had IFRAMEs disabled, that parts of some webpages didn't work - but in ways that weren't obvious: there was something that just didn't show, but with no obvious indication that something was missing. (I think examples included parts of "Verified by Visa", and some Captchas.) -- J. P. Gilliver. UMRA: 1960/1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf Practicall every British actor with a bus pass is in there ... Barry Norman (on "The Best Exotic Marigold Hotel" [2011]), RT 2015/12/12-18 |
#9
|
|||
|
|||
Greasemonkey does its stuff a bit too late. Can it be changed ?
John
Agreed: I found, when I had IFRAMEs disabled, that parts of some webpages didn't work .... Which I why I normally replace such elements with a colored and bordered (empty) DIV (with a title property containing the origional URL), to indicate *something* was there. In the case of such capchas the location of the (neutralized) element is rather revealing to what its usage might have been. I have to mention a mistake I made though: I thought that IMG elements where fully scrubbed, but I just noticed a webpage where I replaced a (1x1 pixel, display:none -- wild guess: a tracking pixel) facebook image, but still saw it pop up in RequestPolicy. :-( Regards, Rudy Wieser |
#10
|
|||
|
|||
Greasemonkey does its stuff a bit too late. Can it be changed ?
In message , R.Wieser
writes: John Agreed: I found, when I had IFRAMEs disabled, that parts of some webpages didn't work ... Which I why I normally replace such elements with a colored and bordered (empty) DIV (with a title property containing the origional URL), to indicate *something* was there. In the case of such capchas the location of the (neutralized) element is rather revealing to what its usage might have been. Are you talking about web pages you are creating, or do you have some means to automatically do that for downloaded pages? [] -- J. P. Gilliver. UMRA: 1960/1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf Never make the same mistake twice...there are so many new ones to make! |
#11
|
|||
|
|||
Greasemonkey does its stuff a bit too late. Can it be changed ?
John
Are you talking about web pages you are creating, or do you have some means to automatically do that for downloaded pages? The latter. That is what GreaseMonkey is (ment) for. :-) Regards, Rudy Wieser |
#12
|
|||
|
|||
Greasemonkey does its stuff a bit too late. Can it be changed ?
In message , R.Wieser
writes: John Are you talking about web pages you are creating, or do you have some means to automatically do that for downloaded pages? The latter. That is what GreaseMonkey is (ment) for. :-) Regards, Rudy Wieser Thanks. I didn't know what GM did. -- J. P. Gilliver. UMRA: 1960/1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf The early worm gets the bird. |
#13
|
|||
|
|||
Greasemonkey does its stuff a bit too late. Can it be changed ?
John,
Thanks. I didn't know what GM did. Ah, thataway. I must say I like the thing. Shortly said, GM can apply one or more JavaScript scripts to a webpage* (even when the browsers scripting is disabled!), allowing you to remove/add/change/etc anything you like - upto a full rewrite of the page. Like creating a new 'body' element, moving the wanted elements from the origional to it, and than deleting the origional. It gives a very clean (easy to the eyes) experience from an otherwise rather cluttered webpage :-) *the header of each script defines, using wildcard matching, which URLs it should run for, so a script can be told to run on all webpages, a specific single one, or anything in between. Regards, Rudy Wieser |
Thread Tools | |
Display Modes | |
|
|