Find a better heuristic for detecting a Magento 2.x store
See original GitHub issueThis issue is a:
- Bug
- Feature suggestion
- Documentation issue
- Other (Please Specify)
Environment
Question | Answer |
---|---|
Magento version | N/A |
Browser + version | N/A |
node.js version (node -v ) |
N/A |
npm version (npm -v ) |
N/A |
Description
The code used to detect a Magento 2 store and show the tab in DevTools is not great. It checks for one of the following 3 classes:
page-layout-1column
,page-layout-2columns-left
,page-layout-checkout
I’m sure there are pages this breaks on, so we should find a better way.
Requirements:
- Should work on the large majority of Magento 2.x stores
- Should not require installing any additional modules
Expected result:
A more stable implementation of the isMagento2Store
function.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
11+ Best Magento Search Extensions to Enhance User ...
Choose the best Magento search extensions to give your customers an enhanced search functionality. The more they search the better sales you ...
Read more >spam - regex / heuristic to detect repetitive words e.g. "gfgfgfgf ...
Above method detects repetitions from neighboring words, as well, and limits creative ("valid") words, which is not a desirable effect. Examples ...
Read more >How to emulator Store View by Store ID Magento 2.x
You can use emulation as per store view using store id as below /** * \Magento\Store\Model\App\Emulation */ protected $emulation; ...
Read more >How to protect your Magento Store from hackers - Polcode
Read on to find a few relatively simple steps that will protect your Magento 2 store from attackers. Use the best server.
Read more >Guide to Supporting Multiple Magento Stores (for Magento 2.x)
Overview If you have a single Magento 2 server that hosts more than one store, you have two options as you get setup...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Heh, turns out that wasn’t quite enough. Hopefully the newest variant works:
https://github.com/magento/m2-devtools/blob/a68c24acd1a5b2348d17821f568abefaeafc5e49/extension/devtools.js#L37-L44
A guest that only visits pages served from the FPC will not have a cookie. Not sure if that is a relevant scenario for collecting the data for the bundling config.