playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Bug]: PDF Preview is not working on webkit

Open Ransely-Nigrel opened this issue 1 year ago • 6 comments
trafficstars

Version

1.42.1

Steps to reproduce

Run any Test case which requires PDF preview and content validation for webkit browser

Expected behavior

PDF should be preview on clicking on it

Actual behavior

PDF is not previewed and blank PDF is displayed for webkit browser

Additional context

It worked with firefox with below launch options

name: 'firefox', use: { ...devices['Desktop Firefox'], storageState: 'tests/.auth/user.json', launchOptions: { firefoxUserPrefs: { "pdfjs.disabled": false, } } }, dependencies: ['setup']

Environment

System
OS: Windows 11
Node: version 16

Ransely-Nigrel avatar Jun 25 '24 09:06 Ransely-Nigrel

PDF preview is not a part of WebContent, rather a Safari plugin. It is outside of scope for Playwright testing.

pavelfeldman avatar Jun 25 '24 15:06 pavelfeldman

I don't know what ENABLE_PDFJS is. But, GTK and WPE ports enable it. https://github.com/WebKit/WebKit/blob/3fcd2236523c0c65609407eed1ff48fd0f7e12b9/Source/cmake/OptionsGTK.cmake#L93

fujii avatar Jun 27 '24 00:06 fujii

I don't know what ENABLE_PDFJS is. But, GTK and WPE ports enable it.

There isn't much we can test / validate about the pdf viewer.

pavelfeldman avatar Jun 27 '24 01:06 pavelfeldman

I think we'd much rather prefer that pdfs trigger downloads, like WK/FF are already doing as per https://github.com/microsoft/playwright/issues/7822.

mxschmitt avatar Jun 27 '24 18:06 mxschmitt

I don't know what ENABLE_PDFJS is. But, GTK and WPE ports enable it. https://github.com/WebKit/WebKit/blob/3fcd2236523c0c65609407eed1ff48fd0f7e12b9/Source/cmake/OptionsGTK.cmake#L93

How can we add it in the config for enabling in webkit , like we have done for forefox above ?

Ransely-Nigrel avatar Jun 28 '24 05:06 Ransely-Nigrel

How can we add it in the config for enabling in webkit , like we have done for forefox above ?

There is no such config in Playwright.

pavelfeldman avatar Jun 28 '24 17:06 pavelfeldman

Folding into https://github.com/microsoft/playwright/issues/7822 - enabling PDF viewer is outside of our e2e testing scope.

mxschmitt avatar Jul 02 '24 10:07 mxschmitt