Problem/Motivation
Please check this issue https://github.com/GoogleChrome/lighthouse/issues/11969
As said - document.write() is a winner at this place https://git.drupalcode.org/project/seckit/-/blob/8.x-1.x/js/seckit.docum... , but actually yep, it's better to redo this featured thing without js somehow, because seckit.no_body.css is anyway loading always, but not used, when commented. Means.. why need to load it then?


| Comment | File | Size | Author |
|---|---|---|---|
| #29 | seckit-3193443-29.patch | 3.18 KB | manish.upadhyay |
| #21 | seckit-3193443-20.patch | 2.89 KB | alina.basarabeanu |
| #17 | seckit-3193443-17.patch | 2.83 KB | john.oltman |
| #6 | 3193443-6.patch | 626 bytes | Pooja Ganjage |
| #3 | 3193443-3.patch | 361 bytes | Pooja Ganjage |
Issue fork seckit-3193443
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
kostyashupenkoComment #3
Pooja Ganjage commentedHi,
Creating a patch for this issue.
Please review the patch.
Let me know if any suggestions.
Thanks.
Comment #4
Pooja Ganjage commentedComment #5
kumar ashutosh commentedPatch #3 used, but the screen returns nothing. CSS from the Seckit module apply
body { display:none; }. I think that is not good option.Comment #6
Pooja Ganjage commentedHi,
Creating an updated patch.
Please review.
Let me know if any suggestions.
Thanks.
Comment #7
kostyashupenko@pooja-ganjage, thanks for working on this issue, but your patches tells that it looks like you don't understand what you are doing at all
Comment #8
kostyashupenkoDescribed issue is about one css file, which shouldn't be loaded if no need.
Currently
seckit.no_body.cssloads always, but hidden if some js conditions. Js file should be removed and logic of load/not loadseckit.no_body.cssfile should be done from phpComment #9
kostyashupenkoComment #10
raghwendra commentedI am also facing problme with "Avoid using document.write('
Comment #11
john.oltman commentedDo not use
Comment #12
john.oltman commentedComment #13
john.oltman commentedDo not use
Comment #16
john.oltman commentedComment #17
john.oltman commentedRevised patch applies to 8.x and 2.x branches. Instead of doing a document.write, it sets the display property on the body field.
Comment #18
alina.basarabeanu commentedPatch #17 works on Drupal core 9.4.8, PHP 8.0.21 and Seckit 2.0.0 even if the tests are failing.
Is there any chance to get merged into dev or a new stable release?
Comment #19
rajeshreeputraComment #20
jjsanzThe latest patch breacks "better toolbar" padding top...
Comment #21
alina.basarabeanu commentedJust discovered that the latest patch breaks the XML sitemap.
When viewing the website sitemap in Firefox an error is shown: XML Parsing Error: not well-formed
Set the defer attribute as defer="defer" instead of just 'defer' for the seckit.frame_check.js file.
Updated patch added.
Comment #22
alina.basarabeanu commentedComment #23
rajeshreeputraComment #24
damienmckennaShould this be moved to the 2.0.x branch?
Comment #25
damienmckennaMoving to the 2.0.x/2.x branch because the 8.x-1.x branch is no longer supported.
Comment #26
manish.upadhyay commentedComment #28
manish.upadhyay commentedUpdated patch.
Comment #29
manish.upadhyay commentedComment #37
luismagr commentedHi,
I've experienced the same issue while trying to run storybook on a drupal installation with seckit installed on it. I've created a MR that prevent the error. Probably there's a plan to fix this in another way but for now, it seems this works well for my issue.
Happy to continue with the issue if someone points me to a better direction.
Thanks
Comment #39
the_g_bomb commentedHi,
@luismagr there is a solution offered already that solves this in #21, your MR in #30 does not include the complete solution.
@manish.upadhyay I think your patch at #29 is close, but I don't think defer="defer" can be used for css
Comment #41
the_g_bomb commentedPushed a reroll of #21 applying to the 2.x branch.
This patch can be used if needed:
https://git.drupalcode.org/project/seckit/-/merge_requests/46.diff
Comment #42
sergiurI tested this patch and it seems to be working correctly.
To test I disabled clickjacking protection (seckit_clickjacking.x_frame = 0) on one site and iframed it in another site. The other site showed a white/empty iframe, with the following message in console:
This patch also has the added benefit of fixing the XML Sitemap page when stylesheets are enabled, so it should solve this issue at the same time: #3219252: Breaks sitemap.xml when JS +CSS + Noscript protection is enabled
Thank you!