User tests: Successful: Unsuccessful:
Pull Request for Issue #28557
Make sure there renderer does not manipulate the inline CSS and JS
Add the following lines to the index.php of the cassiopea template:
// Add inline JavaScript
Factory::getDocument()->addScriptDeclaration('
window.event("domready", function() {
alert("An inline JavaScript Declaration");
});
');
// Add inline Style
Factory::getDocument()->addStyleDeclaration('
body {
background: #00ff00;
color: rgb(0,0,255);
}
');
Enable CSP (System -> Content-Security-Policy -> Options) and configure like this:
inline script and inline style tags are not modified by the renderer and can be whitelisted via an csp.
the style and script renderer add some spaces and line endings that breaks the CSP hash generation.
none
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries Front End Plugins |
Labels |
Added:
?
?
|
Pls overlook my ignorance, isn't it cassiopea on J4?
Yes thanks fixed. I worked in parallel on protostar too :D
Title |
|
Title |
|
This is going to make the source look much worse when debugging. But then again given everyone uses dev tools in browsers these days I guess it doesn't matter much either?
This is going to make the source look much worse when debugging. But then again given everyone uses dev tools in browsers these days I guess it doesn't matter much either?
I have not noticed any difference in the dev tools.
BTW you should not use any inline JS or Inline CSS anyway so one more reason to not use them :D
Yes thans fixed. I worked in parallel on protostar too :D
Thanks Tobias, I need a bit more info as running into some wierdness.
With security policy enabled or disabled, I get this warning:
( ! ) Warning: hash() expects parameter 2 to be string, array given in F:\xampp\htdocs\j4test\plugins\system\httpheaders\httpheaders.php on line 178
Can I ignore?
Also, I'm testing this locally, that OK for this PR?
Yes you can ignore it. That is an issue that has been patched here too when you apply the patch that Warning should be gone too.
Priority | Medium | ⇒ | Urgent |
Labels |
Added:
?
Removed: ? |
I have tested this item
Tested with Chrome on Win64
I have tested this item
Tested successfully.
CDATA for xhtml/xml document, and as long as Document may be used for render XML I would keep it. Even if we never used it
Ok right now to me this PR looks ready than given that I do not touch the CDATA thing and that we only apply hashes on HTML sites anyway.
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-08-11 18:11:31 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
Information Required
?
Removed: ? |
I'm still not 100% we're getting this right - but let's give it a go
Here is the backport to 3.x: #28720