-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Screenshotting] PoC print media #126913
[Screenshotting] PoC print media #126913
Conversation
const mediaAwareStyleLoaders = [ | ||
{ | ||
resourceQuery: /print/, | ||
loader: 'style-loader', | ||
options: { | ||
attributes: { 'data-print-media-style': 'true' }, | ||
}, | ||
}, | ||
{ | ||
resourceQuery: undefined, | ||
loader: 'style-loader', | ||
options: { | ||
attributes: { media: 'screen, projection' }, | ||
}, | ||
}, | ||
]; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version of style-loader
we are using has a known bug for setting the media
attribute on style tags webpack-contrib/style-loader#458
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a work-around that instead uses the MutationObserver
hacked into core for updating media attributes based on the presence of the data-print-media-style
. The result of this is the print styles "flash" once as they are applied by the browser until the MutationObserver
kicks in. Very hacky, but work-around for rather not updating style-loader + webpack to latest version.
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💔 Build FailedFailed CI StepsTest Failures
Metrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Summary
Demonstration (focussing on the
dashboard
plugin) of how we might leverage browser printing functionality for creating PNG or PDF reports. This will enable users to print certain pages of Kibana in their browser rather than requesting a report from the Kibana server.If this work succeeds it may have far-reaching implications:
pdfmake
, and instead utilise existing browser functionaliyWith this PoC we want to establish that we can:
preserve-layout
style reports (PDF & PNG)print-optimized
style reports (PDF only)canvas
, multi-page style reports (PDF only)Rest of the description TODO
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers