Closed stefxx closed 1 year ago
I just tested with the latest version of the Sample plugin; same issue. Probably much easier to replicate!
Just start the Sample plugin, create an event, select "Sample plugin action - Write to log" and select any "Log type". It stops right there with the same error in the Console debug.
I can reproduce the problem. Tracked as HS-1713 Seems to be a breakage in Chrome version 105 and some jquery instructions: https://github.com/jquery/jquery/issues/5098
Thanks Spudd, appreciate your confirmation. Seems like a Chromium bug. Or can this (also?) be solved within HS4?
I just ran into this as well using Edge. It looks like the :has
CSS selector is not officially supported by all major browsers: https://developer.mozilla.org/en-US/docs/Web/CSS/:has#browser_compatibility and a recent Chromium change broke it.
I would recommend rather than waiting for a fix in Chromium, we could insulate HS from future breaking changes to :has
and replace its use with vanilla jQuery for DOM traversal. There are only 4 lines in /html/bootstrap/js/jui-events.js
that use :has
and can be easily switched to use jQuery's .parents()
.
For example, replacing lines 178-179:
var viewIdEscaped = view.id.replace(/\./g, '\\.');
var pagediv = $('div.container.jui-page:has(#' + viewIdEscaped + ')')[0];
With the following:
var pagediv = $(view).parents('div.container.jui-page')[0];
I've attached a fully patched jui-events.js
file based on HS 4.2.14.0
jui-events.js.txt
This problem is fixed in Chrome 106.0.5249.30 available as a beta version
But you're right, we should replace the :has
CSS selector with something else to prevent future problems.
I applied the jui-events.js patch and it works.
This issue is fixed in HS version 4.2.16.0
Environment
HomeSeer
OS
Windows
HS Version
[v4.2.15.0]
Development
PSDK Version
[v1.4.2.0]
Language
[VB]
IDE
[VS2019]
Dev OS
[Windows]
Plugin
Pushover, UniFi, LG ThinQ etc.
Problem
Since the latest release of Chome (105.0.5195.102) and Edge new events generate an error after InitFullConfigPage and new event properties are not being shown. The following error is in the browser console debug window: Uncaught TypeError: Cannot read properties of undefined (reading 'getAttribute') at HTMLSelectElement.viewValueChanged (events.html?ref=2&su…=event.html:1321:30) at HTMLDocument.dispatch (jquery-3.4.0.min.js:2:42523) at v.handle (jquery-3.4.0.min.js:2:40524) at MaterialSelect._triggerChangeOnNativeSelect (mdb.js:18418:35) at MaterialSelect._onEachMaterialOptionClick (mdb.js:18395:14) at HTMLLIElement.dispatch (jquery-3.4.0.min.js:2:42523) at v.handle (jquery-3.4.0.min.js:2:40524) viewValueChanged @ events.html?ref=2&su…age=event.html:1321 dispatch @ jquery-3.4.0.min.js:2 v.handle @ jquery-3.4.0.min.js:2 _triggerChangeOnNativeSelect @ mdb.js:18418 _onEachMaterialOptionClick @ mdb.js:18395 dispatch @ jquery-3.4.0.min.js:2 v.handle @ jquery-3.4.0.min.js:2
Description
Users of several of my plugins cannot create new events anymore. Using Firefox is still working fine.
Expected Behavior
New properties defined in InitFullConfigPage should be displayed as before.
Steps to Reproduce
Install Pushover, LG ThinQ or UniFi (probably best to use Pushover as that is most easy to configure) and create an Pushover event. After selecting the message type to be send, the problem will be obvious.
Screenshots
See forum post: https://forums.homeseer.com/forum/hs4-products/hs4-plugins/phone-text-email-plug-ins-aa/pushover-stefxx/1564440-weird-behavior-in-chrome-vs-firefox
Logs
Let me know what more information you need!