为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

When printing maps with directions from Google Maps, I can only print part of the directions.

  • 9 个回答
  • 32 人有此问题
  • 1 次查看
  • 最后回复者为 fortfun

more options

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!

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!

被采纳的解决方案

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.)

定位到答案原位置 👍 10

所有回复 (9)

more options

选择的解决方案

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.)

由jscher2000 - Support Volunteer于修改

more options

That seems to have worked! Thanks!

more options

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

more options

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.

more options

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

由joker0091于修改

more options

Hi joker0091, good point. I'll add that to the "Solution" post for quick reference.

more options

I was hoping Firefox 50 would solve this problem, but alas it doesn't. Is it on the radar for a permanent fix?

more options

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.

more options

Thanks for the reply jscher2000. At least it's on the list to be fixed.