![Firefox logo](https://assets-prod.sumo.prod.webservices.mozgcp.net/media/uploads/products/2020-04-14-08-36-13-8dda6f.png)
When printing maps with directions from Google Maps, I can only print part of the directions.
When I select print in Google maps and print, the first page is the map, the second page is part of the directions, and the third page is blank. I've tried in Safari and this doesn't happen there - the map plus directions print out the way the should. This started happening in Firefox about two weeks ago. I've tried to adjust print settings in Firefox and I've also reset the print settings in about:config. So far, nothing has worked. I'm using an HP OfficeJet Pro 8600 and I've not had any similar problems in the past.
Thanks!
Giải pháp được chọn
Unfortunately, Google has modified the layout of the page. It has added a style rule to the directions list that Firefox 47 does not paginate, or in other words, Firefox keeps the direction list together as a block so you can only print as much of that block as fits on one page. The only way to work around this right now is to "hack" the page to override that rule. Hopefully it will be solved in a future version of Firefox.
To hack the page, you're going to run a short script in the Web Console. If you find you need to do this often, you could create a bookmarklet (a script attached to a bookmark) so it's a one-click operation.
Single-Use method
(A) Select this entire script and right-click > Copy it:
document.querySelector('div.widget-pane-section-listbox.widget-pane-section-listbox-root').style.display="block";
Update:
document.querySelector('div.section-listbox.section-listbox-root').style.display="block";
(B) In the tab with the print-formatted directions page, open Firefox's Web Console in the lower part of the tab using any of these methods:
- Ctrl+Shift+k
- "3-bar" menu button > Developer > Web Console
- (menu bar) Tools > Web Developer > Web Console
(C) Click next to the caret (>>) at the bottom of the Web Console and paste the script (Ctrl+v or right-click > Paste) and then press Enter to run it.
(D) Close the web console using either the small "x" on the right end of the bar listing Inspector, Console, etc., or the keyboard shortcut Ctrl+Shift+i might do it.
If you go into Print Preview, you should now see the list split across pages normally. Success?
Creating a Bookmarklet
A bookmarklet is a short script that you save on your Bookmarks Toolbar or Bookmarks Menu, in a convenient spot. Here's how to create that:
(1) Select this entire script and right-click > Copy it:
javascript:void(document.querySelector('div.section-listbox.section-listbox-root').style.display="block");
(2) Right-click a convenient place on your Bookmarks Toolbar or Bookmarks Menu and choose New Bookmark
(3) Click in the empty box next to Location and paste the script
(4) Assign a relevant name like GooMapPrint
(5) Click the Add Bookmark button
To test it out, after loading the "print" view of directions, click the button. When you call up print preview, the steps should be paginated normally.
(Some sites use a Content Security Policy to forbid external scripts from being applied. On those sites, bookmarklets do not work -- but at least so far, Google doesn't do that.)
Đọc câu trả lời này trong ngữ cảnh 👍 10Tất cả các câu trả lời (9)
Giải pháp được chọn
Unfortunately, Google has modified the layout of the page. It has added a style rule to the directions list that Firefox 47 does not paginate, or in other words, Firefox keeps the direction list together as a block so you can only print as much of that block as fits on one page. The only way to work around this right now is to "hack" the page to override that rule. Hopefully it will be solved in a future version of Firefox.
To hack the page, you're going to run a short script in the Web Console. If you find you need to do this often, you could create a bookmarklet (a script attached to a bookmark) so it's a one-click operation.
Single-Use method
(A) Select this entire script and right-click > Copy it:
document.querySelector('div.widget-pane-section-listbox.widget-pane-section-listbox-root').style.display="block";
Update:
document.querySelector('div.section-listbox.section-listbox-root').style.display="block";
(B) In the tab with the print-formatted directions page, open Firefox's Web Console in the lower part of the tab using any of these methods:
- Ctrl+Shift+k
- "3-bar" menu button > Developer > Web Console
- (menu bar) Tools > Web Developer > Web Console
(C) Click next to the caret (>>) at the bottom of the Web Console and paste the script (Ctrl+v or right-click > Paste) and then press Enter to run it.
(D) Close the web console using either the small "x" on the right end of the bar listing Inspector, Console, etc., or the keyboard shortcut Ctrl+Shift+i might do it.
If you go into Print Preview, you should now see the list split across pages normally. Success?
Creating a Bookmarklet
A bookmarklet is a short script that you save on your Bookmarks Toolbar or Bookmarks Menu, in a convenient spot. Here's how to create that:
(1) Select this entire script and right-click > Copy it:
javascript:void(document.querySelector('div.section-listbox.section-listbox-root').style.display="block");
(2) Right-click a convenient place on your Bookmarks Toolbar or Bookmarks Menu and choose New Bookmark
(3) Click in the empty box next to Location and paste the script
(4) Assign a relevant name like GooMapPrint
(5) Click the Add Bookmark button
To test it out, after loading the "print" view of directions, click the button. When you call up print preview, the steps should be paginated normally.
(Some sites use a Content Security Policy to forbid external scripts from being applied. On those sites, bookmarklets do not work -- but at least so far, Google doesn't do that.)
Được chỉnh sửa bởi jscher2000 - Support Volunteer vào
That seems to have worked! Thanks!
Alas - This problem is now reappearing, despite adding using the instructions above and re-pasted below. Instead of getting a "block" after following those instructions, I now get: TypeError: document.querySelector(...) is null
Are there any other fixes?
A) Select this entire script and right-click > Copy it:
document.querySelector('div.widget-pane-section-listbox.widget-pane-section-listbox-root').style.display="block";
(B) In the tab with the print-formatted directions page, open Firefox's Web Console in the lower part of the tab using any of these methods:
Ctrl+Shift+k "3-bar" menu button > Developer > Web Console (menu bar) Tools > Web Developer > Web Console
(C) Click next to the caret (>>) at the bottom of the Web Console and paste the script (Ctrl+v or right-click > Paste) and then press Enter to run it.
(D) Close the web console using either the small "x" on the right end of the bar listing Inspector, Console, etc., or the keyboard shortcut Ctrl+Shift+i might do it.
I
Google often changes things... the class names we have to use in the code are a bit different now:
document.querySelector('div.section-listbox.section-listbox-root').style.display="block";
I'm going to update the original post, too.
Can you please update with the process to create the bookmarklet? I use this every day and it would be easier to not have to paste the code every time. Thanks
Được chỉnh sửa bởi joker0091 vào
Hi joker0091, good point. I'll add that to the "Solution" post for quick reference.
I was hoping Firefox 50 would solve this problem, but alas it doesn't. Is it on the radar for a permanent fix?
The person to whom it has been assigned has 1500 bugs on his list, so I'm not sure when it might come up for fixing... I suspect no change will roll out in 2016 unless a lot more broken sites are identified.
Thanks for the reply jscher2000. At least it's on the list to be fixed.