Open in new window to print, reports window as about:blank

Folks,

If we use the “tiddler” open in new window we can ctrl-p in Chrome/Edge and Firefox to print. You can even use style="page-break-before: always;" so you get page breaks in your content. Even smarter tables can break across pages and more.

  • If you save or print to PDF with an appropriate ‘‘PDF printer’’ the print dialogue also allows you to change margins, and headers and footers including page N of X.

I like this option however with the way ‘‘open in new window’’ works it is displaying about: blank in the bottom left.

Does anyone know where this comes from and how to give it a different value?

  • Ideally we may set it to the tiddler name or optional value.
  • I suspect it has something to do with the window.name or target value.

I can’t reproduce this with firefox.

Open in new window, then print

What does it say on the bottom left of the page?

Thats where I see about: blank which is not good on a resume I am printing.

For example bottom left, with custom margins active

Snag_2d114ae

Bottom right page/total
Snag_2d25963

[Edited] On another site, using print to PDF the bottom left had an ugly url. So I suspect we can stuff it with another value somehow.

In Windows system print dialog that shows the Preview and choices for the “Destination”, “Pages”, and “Layout”, there is also a “More Settings” command.

When you click “More Settings”, it will show settings for: “Paper size”, “Pages per sheet”, “Margins”, “Scale”, and “Options”.

In the “Options” section, there are two checkboxes: “Headers and footers” and “Background graphics”.

Clear the “Headers and footers” checkbox to remove the unwanted timestamp, window title, URL, and page number outputs that normally appear in the corners of the printed page.

In my screenshot it says “Page 1, 2 page in total” in Chinese.

So seems every OS and browser has different result?

Actually I think the difference comes from the print drivers.

  • I am happy with everything except the “about:blank” I want to find how to change that.

I’d suggest for something you want to print, setup a custom print button on that tiddler.

Have the print button reopen the TiddlyWiki in a new tab, but using a permalink to the tiddler you want to print. Printing in that newly opened TiddlyWiki instance will have the nice URL on the page. The URL being a permalink to the specific tiddler, I think that’s a good thing. Well, if you want that kind of URL showing.

I had no idea.

  • Yes, not really, permalinks are brutal
  • In this case generated by our “Open in new window button” that is why I hope we can alter it.

I will see if I can inspect the source in the window and identify if it can be manipulated.

I will proceed with this annoying about:blank however perhaps work it out eventually. It has something to do with the way tiddlywiki opens a new window.

The issue here is that browsers are hardwired to show the URL “about:blank” for windows that are created in JavaScript using the “window.open” function.

I don’t think that there is a mechanism to change the displayed URL, but if you want to explore more a good search term to start with is “window open with custom html”. There are a lot of Stack Overflow answers that give precisely the technique that is already used in TiddlyWiki.

I suspect that a more fruitful area for exploration would be customising the printed output to remove the footers. Googling “browser print window without url footer” returns quite a few responses that cover the same checkbox discussed above.

2 Likes

Thanks @jeremyruston the problem is if you want to generate headers and rooters rather than using the default in print drivers is complex and messy. I did it previously but may revisit.

  • if course good print output would be an advantage to tiddlywiki.

Just an update the artifact I want to remove is as a result of the printer/printer driver we use. I have found a FireFox plugin (Chrome as well apparently) that promises to be a solution as it allows one to make adjustments pre-print.

  • With open in new window you can access the addon using the r-click menu
  • I am still to work out if this is going to be a valuable tool for tiddlywiki print output.
  • If this does not work perhaps something else will?