Bug 264317 - Log quirks on the Console of Web Inspector when browsing a website
Summary: Log quirks on the Console of Web Inspector when browsing a website
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: Safari 17
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brandon
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-11-06 21:29 PST by Karl Dubost
Modified: 2024-08-19 10:18 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Dubost 2023-11-06 21:29:49 PST
Quirks are a mechanism to fix websites breaking in Safari for different type of reasons.
See https://github.com/WebKit/WebKit/blob/main/Source/WebCore/page/Quirks.cpp

There are often triggered based on domain names.
We need a mechanism to advertise in the Web Inspector Console, that this specific Quirk is happening for this site.
The goal is to raise awareness to Web developers of these sites that something need to be fixed on their site and/or help them understand to understand when the current behavior is unexpected.
Comment 1 Karl Dubost 2023-11-06 21:30:33 PST
<rdar://114721582>
Comment 2 Karl Dubost 2023-11-06 21:53:50 PST
An additional question that could be a separate bug related to this bug. 
Should the Quirks be documented on an external site (https://webkit.org/)?
It could be as simple as one liners. 

Ahmad had ideas on the type of informations.
Comment 3 Karl Dubost 2024-07-01 22:59:01 PDT
Note:
What should it be done when the Quirk is being matched a couple of times? 

* Send the information just once per URL?
* Send the information every time there is a match (it can become spammy, but we could wrap them like Jon Davis did for Sourcemap errors) Bug 256683 or could it give more information on where exactly the quirk is happening so that the webdev understands how to fix it.
Comment 4 Karl Dubost 2024-07-01 22:59:50 PDT
From Brandon Stewart, a way to add a message:

```
m_document->addConsoleMessage(makeUnique<Inspector::ConsoleMessage>(MessageSource::JS, MessageType::Log, MessageLevel::Warning, "Quirk is enabled."_s));
```