Skip to content

Commit

Permalink
Bug 1803576 - Add Save page as PDF Quickaction. r=daisuke,fluent-revi…
Browse files Browse the repository at this point in the history
…ewers,kpatenio

Differential Revision: https://phabricator.services.mozilla.com/D193757

UltraBlame original commit: 42604daaa4d12dc7ae0911491ab047b8600c1917
  • Loading branch information
marco-c committed Nov 21, 2023
1 parent c811045 commit 777fb82
Show file tree
Hide file tree
Showing 2 changed files with 164 additions and 0 deletions.
138 changes: 138 additions & 0 deletions browser/components/urlbar/QuickActionsLoaderDefault.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,144 @@ onPick
:
restartBrowser
}
savepdf
:
{
l10nCommands
:
[
"
quickactions
-
cmd
-
savepdf
"
]
label
:
"
quickactions
-
savepdf
"
icon
:
"
chrome
:
/
/
global
/
skin
/
icons
/
print
.
svg
"
onPick
:
(
)
=
>
{
/
/
This
writes
over
the
users
last
used
printer
which
we
/
/
should
not
do
.
Refactor
to
launch
the
print
preview
with
/
/
custom
settings
.
let
win
=
lazy
.
BrowserWindowTracker
.
getTopWindow
(
)
;
Cc
[
"
mozilla
.
org
/
gfx
/
printsettings
-
service
;
1
"
]
.
getService
(
Ci
.
nsIPrintSettingsService
)
.
maybeSaveLastUsedPrinterNameToPrefs
(
win
.
PrintUtils
.
SAVE_TO_PDF_PRINTER
)
;
win
.
PrintUtils
.
startPrintWindow
(
win
.
gBrowser
.
selectedBrowser
.
browsingContext
{
}
)
;
}
}
screenshot
:
{
Expand Down
26 changes: 26 additions & 0 deletions browser/locales/en-US/browser/browser.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -2493,6 +2493,32 @@ print
print
#
Opens
the
print
dialog
at
the
save
to
PDF
option
quickactions
-
savepdf
=
Save
page
as
PDF
quickactions
-
cmd
-
savepdf
=
pdf
#
Opens
a
new
private
Expand Down

0 comments on commit 777fb82

Please sign in to comment.