How to apply CSS with GM v3.17 in Firefox v52.5.2 on Google-translated web page?

55 views
Skip to first unread message

Ben

unread,
Dec 13, 2017, 7:00:54 AM12/13/17
to greasemonkey-users
Assume I installed the older GM v3.17 version in a (portable) Firefox v52.5.2 (under Win7).
Again: I am talking about the "old" GM+Firefox world.

Now I load a certain page (here: german newsmagazine) into Google translator (here: Google Netherlands):

Now I right-click on the "Drucken" (=print) link just right of the article date and select "Open link in new tab" from context menu.

The print layout page appears on a new tab

Onto this page I want to apply the following GM script (see bottom of this posting):

Unfortunately the line-height is NOT changed.

Why?

If I change it manually in Firefox development tools everything works.
However I want to automate it.

Ben


// ==UserScript==
// @name            ChangeLayoutSpiegel
// @namespace       nsChangeLayoutSpiegel
// @description     Change Layout spiegel.de
// @include         http://translate.googleusercontent.com/*
// @include         http://translate.google.com/*
// @version         1.7.0
// @grant           GM_addStyle
// @require         http://code.jquery.com/jquery-latest.js
// ==/UserScript==

GM_addStyle("html { line-height: 13px !important; }");

Klaus Johannes Rusch

unread,
Dec 13, 2017, 10:23:49 AM12/13/17
to greasemon...@googlegroups.com
On 2017-12-13 13:00, 'Ben' via greasemonkey-users wrote:
> The print layout page appears on a new tab
>
> Onto this page I want to apply the following GM script (see bottom of
> this posting):
>
> Unfortunately the line-height is NOT changed.

Just a guess since I no longer have the old version of GM running: The
style change may not be applied by the time the inline script that calls
the browser print function (window.print()) executes.

You can control when the GM code executes by setting

// @run-at document-start

--
Klaus Johannes Rusch
klaus...@atmedia.net
http://klausrusch.atmedia.net/

Reply all
Reply to author
Forward
0 new messages