pageMod css not applied in print preview

hi,

as the title sais: css provided by css file in a PageMod is not applied in print and print preview. how do you guys handle this problem?

thanks!

Can you show us the code for your pageMod.

There should be a contentStyleFile attribute for it. Its similar to contentScriptFile.

Here it is. As i said, it works fine when viewing pages but fails when I try to print-preview these same pages. I simplified the code a bit:

require(“sdk/page-mod”).PageMod({
include:"*",
attachTo:[“existing”,“top”,“frame”],
contentStyleFile:require(“sdk/self”).data.url(“css/common.css”)
});

Noone had a need to also apply css to printed webpage?

In chrome and opera this works fine, once included css affects also the printed page.

submit a bug report on bugzilla

i did.

https://bugzilla.mozilla.org/show_bug.cgi?id=1237281

A month has passed, noone cared about this so I’ll try again:

Can someone help me with this?
How to hide an element with addon SDK on a printed page?

1 Like

Editing the print setup page is tricky stuff, but I recall seeing an addon that did it.

I think this one does it please check it out and share what you learn:

https://addons.mozilla.org/en-US/firefox/addon/customize-print/?src=search

The reason pageMod doesn’t work is because it’s not really a page. I think you won’t be able to use pageMod here you will have to hack into the XUL.

Did you try linking / overriding the style using print media? See this doc for info. I don’t know if the Firefox print preview respects these changes or reloads the page, though.

this doesn’t work.