johnmichel / Library-Detector-for-Chrome

🔍 Extension that detects which JavaScript libraries are running on a page
https://chrome.google.com/webstore/detail/cgaocdmhkmfnkdkbnckgmpopcbpaaejo
MIT License
658 stars 112 forks source link

Add October CMS #187

Closed summercms closed 3 years ago

summercms commented 3 years ago

Looking at other detection platforms they detect October CMS using the following methods:

  1. Meta-tag (generator): "OctoberCMS"

  2. Cookie Name: "october_session"

  3. October's Framework Files:

/modules/system/assets/css/framework.extras-min.css
/modules/system/assets/js/framework.combined-min.js
/modules/system/assets/css/framework.extras-min.css
/modules/system/assets/js/framework.combined-min.js

Detecting one of these files.

Jumped into the deep end and wrote this code, hopefully it's correct.

p.s. This is to make the Lighthouse Stack Pack work and get detected, found here: https://github.com/GoogleChrome/lighthouse-stack-packs/pull/57

LukeTowers commented 3 years ago

@ayumi-cloud are you able to add the cookie detection?

summercms commented 3 years ago

@LukeTowers no, I tried running some tests using this code:

document.cookie.match(/^(.*;)?\s*october_session\s*=\s*[^;]+(.*)?$/);

and

document.cookie.match(new RegExp("(^| )" + "october_session" + "=([^;]+)"));

etc.

Didn't work, due to the cms using the settings:

httpOnly - true
secure - true
sameSite - lax

I checked the library/libraries.js in this repo, seems like no one is checking cookies.

Real shame as would have been nice to also add that check.

summercms commented 3 years ago

Linked to stack pack pr: https://github.com/GoogleChrome/lighthouse-stack-packs/pull/58

housseindjirdeh commented 3 years ago

Looks great 👍