spm仓库支持,通用仓库
lpw
2026-02-03 b4e4ae3f9448a7232314eb83698e6897e6f34fc3
WASdkImpl/Didomi.xcframework/xros-arm64/Didomi.framework/web_sdk_utilities.js
@@ -350,13 +350,19 @@
function toggleFirstSlider() {
  new Promise(function(resolve) {
    setTimeout(() => {  // Add delay to let time for the element to be attached
      var element = document.getElementsByClassName('didomi-switch')[0];
      if (element) {
        element.click();
        resolve(true);
      } else {
        resolve(false);
      var elements = document.getElementsByClassName('didomi-switch');
      var clicked = false;
      // Click on 1st active slider
      for (var index = 0; index < elements.length; index++) {
        if (isClickable(elements[index])) {
          elements[index].click();
          clicked = true;
          break;
        }
      }
      resolve(clicked);
    }, 100);
  }).then((result) => {
      enabledToggleIsCachedOrNotRequired(result);
@@ -364,6 +370,16 @@
}
/**
 * Check if a DOM element is clickable (visible and not disabled)
 */
function isClickable(element) {
  if (element.disabled) return false;
  if (element.style.display === 'none' || element.style.visibility === 'hidden') return false;
  if (element.offsetParent === null) return false;
  return true;
}
/**
 * If the preferences page shows toggles, we let the native code know that the enable toggle image should be loaded on the page and cached now.
 * If the preferences page does not show toggles, we also let native know that we can continue.
 * @param {*} result whether the toggle has been found and clicked or not.