English Community-Lenovo Community(function(win, doc) {
var STORAGE_KEY = 'newVersion';
var BLOCK_KEYWORDS = ['digitalfeedback', 'confirmit.com'];
var RESOURCE_SELECTOR = 'script[src],link[href],img[src],iframe[src],source[src],audio[src],video[src],embed[src],object[data],link[rel="dns-prefetch"][href],link[rel="preconnect"][href],link[rel="prefetch"][href]';
var blockerState = {
enabled: false,
observer: null
};
function safeParseBoolean(value, defaultValue) {
if (value === null || typeof value === 'undefined' || value === '') return defaultValue;
if (typeof value === 'boolean') return value;
try {
return JSON.parse(value);
} catch (e) {
return value === 'true';
}
}
function getPersistedNewVersion() {
var storedValue = null;
try {
storedValue = win.sessionStorage.getItem(STORAGE_KEY);
} catch (e) {}
if (storedValue === null) {
try {
storedValue = win.localStorage.getItem(STORAGE_KEY);
} catch (e) {}
}
return safeParseBoolean(storedValue, true);
}
function normalizeUrl(url) {
if (!url) return '';
try {
var anchor = doc.createElement('a');
anchor.href = String(url);
return (anchor.href || String(url)).toLowerCase();
} catch (e) {
return String(url).toLowerCase();
}
}
function shouldBlockUrl(url) {
var normalizedUrl = normalizeUrl(url);
var i = 0;
if (!normalizedUrl) return false;
for (i = 0; i < BLOCK_KEYWORDS.length; i++) {
if (normalizedUrl.indexOf(BLOCK_KEYWORDS[i]) > -1) {
return true;
}
}
return false;
}
function getNodeResourceUrl(node) {
if (!node || node.nodeType !== 1) return '';
return node.getAttribute('src') || node.getAttribute('href') || node.getAttribute('data') || node.src || node.href || node.data || '';
}
function removeNode(node) {
if (node && node.parentNode) {
node.parentNode.removeChild(node);
}
}
function hasBlockedDescendant(root) {
var nodes;
var i;
if (!root || !root.querySelectorAll) return false;
nodes = root.querySelectorAll(RESOURCE_SELECTOR);
for (i = 0; i < nodes.length; i++) {
if (shouldBlockUrl(getNodeResourceUrl(nodes[i]))) {
return true;
}
}
return false;
}
function cleanupBlockedNodes(root) {
var target = root && root.querySelectorAll ? root : doc;
var nodes;
var i;
if (!blockerState.enabled || !target || !target.querySelectorAll) return;
nodes = target.querySelectorAll(RESOURCE_SELECTOR);
for (i = 0; i < nodes.length; i++) {
if (shouldBlockUrl(getNodeResourceUrl(nodes[i]))) {
removeNode(nodes[i]);
}
}
}
function appendResourceHint(rel, href) {
var link;
if (!href || blockerState.enabled || !doc.head) return;
link = doc.createElement('link');
link.rel = rel;
link.href = href;
doc.head.appendChild(link);
}
function patchNodeInsertion(proto, methodName) {
var original;
if (!proto || !proto[methodName]) return;
original = proto[methodName];
proto[methodName] = function(node) {
if (blockerState.enabled && node && node.nodeType === 1) {
if (shouldBlockUrl(getNodeResourceUrl(node))) {
console.warn('[digitalfeedback-blocker] blocked dynamic node insertion', getNodeResourceUrl(node));
cleanupBlockedNodes(node);
return node;
}
if (hasBlockedDescendant(node)) {
cleanupBlockedNodes(node);
}
}
return original.apply(this, arguments);
};
}
function patchSetAttribute() {
var originalSetAttribute;
if (!win.Element || !Element.prototype || !Element.prototype.setAttribute) return;
originalSetAttribute = Element.prototype.setAttribute;
Element.prototype.setAttribute = function(name, value) {
var attrName = (name || '').toLowerCase();
if (blockerState.enabled && (attrName === 'src' || attrName === 'href' || attrName === 'data') && shouldBlockUrl(value)) {
console.warn('[digitalfeedback-blocker] blocked attribute assignment', value);
removeNode(this);
return;
}
return originalSetAttribute.apply(this, arguments);
};
}
function patchProperty(proto, propertyName) {
var descriptor;
if (!proto || !Object.getOwnPropertyDescriptor) return;
descriptor = Object.getOwnPropertyDescriptor(proto, propertyName);
if (!descriptor || !descriptor.configurable || !descriptor.set) return;
Object.defineProperty(proto, propertyName, {
configurable: true,
enumerable: descriptor.enumerable,
get: descriptor.get,
set: function(value) {
if (blockerState.enabled && shouldBlockUrl(value)) {
console.warn('[digitalfeedback-blocker] blocked property assignment', value);
removeNode(this);
return value;
}
return descriptor.set.call(this, value);
}
});
}
function patchFetch() {
var originalFetch = win.fetch;
if (typeof originalFetch !== 'function') return;
win.fetch = function(input, init) {
var url = input && input.url ? input.url : input;
if (blockerState.enabled && shouldBlockUrl(url)) {
console.warn('[digitalfeedback-blocker] blocked fetch request', url);
return Promise.reject(new Error('Blocked digitalfeedback request: ' + url));
}
return originalFetch.call(this, input, init);
};
}
function patchXmlHttpRequest() {
var originalOpen;
var originalSend;
if (!win.XMLHttpRequest || !XMLHttpRequest.prototype) return;
originalOpen = XMLHttpRequest.prototype.open;
originalSend = XMLHttpRequest.prototype.send;
XMLHttpRequest.prototype.open = function(method, url) {
this.__digitalFeedbackBlocked = blockerState.enabled && shouldBlockUrl(url);
this.__digitalFeedbackBlockedUrl = url;
if (this.__digitalFeedbackBlocked) {
console.warn('[digitalfeedback-blocker] blocked XHR request', url);
return;
}
return originalOpen.apply(this, arguments);
};
XMLHttpRequest.prototype.send = function() {
var xhr = this;
if (xhr.__digitalFeedbackBlocked) {
win.setTimeout(function() {
if (typeof xhr.onerror === 'function') xhr.onerror(new Error('Blocked digitalfeedback request: ' + xhr.__digitalFeedbackBlockedUrl));
if (typeof xhr.onloadend === 'function') xhr.onloadend();
if (typeof xhr.dispatchEvent === 'function') {
try {
xhr.dispatchEvent(new Event('error'));
xhr.dispatchEvent(new Event('loadend'));
} catch (e) {}
}
}, 0);
return;
}
return originalSend.apply(this, arguments);
};
}
function patchSendBeacon() {
var originalSendBeacon = navigator && navigator.sendBeacon;
if (typeof originalSendBeacon !== 'function') return;
navigator.sendBeacon = function(url, data) {
if (blockerState.enabled && shouldBlockUrl(url)) {
console.warn('[digitalfeedback-blocker] blocked beacon request', url);
return false;
}
return originalSendBeacon.call(this, url, data);
};
}
function startObserver() {
if (!win.MutationObserver || blockerState.observer || !doc.documentElement) return;
blockerState.observer = new MutationObserver(function(mutations) {
var i;
var j;
var mutation;
var node;
if (!blockerState.enabled) return;
for (i = 0; i < mutations.length; i++) {
mutation = mutations[i];
for (j = 0; j < mutation.addedNodes.length; j++) {
node = mutation.addedNodes[j];
if (node && node.nodeType === 1 && shouldBlockUrl(getNodeResourceUrl(node))) {
removeNode(node);
continue;
}
cleanupBlockedNodes(node);
}
}
});
blockerState.observer.observe(doc.documentElement, { childList: true, subtree: true });
}
function setBlockingEnabled(enabled) {
blockerState.enabled = !!enabled;
win.__BLOCK_DIGITALFEEDBACK__ = blockerState.enabled;
if (blockerState.enabled) {
cleanupBlockedNodes(doc);
}
}
function install() {
if (win.__digitalFeedbackBlocker) return;
patchNodeInsertion(win.Node && win.Node.prototype, 'appendChild');
patchNodeInsertion(win.Node && win.Node.prototype, 'insertBefore');
patchNodeInsertion(win.Node && win.Node.prototype, 'replaceChild');
patchSetAttribute();
patchProperty(win.HTMLScriptElement && HTMLScriptElement.prototype, 'src');
patchProperty(win.HTMLLinkElement && HTMLLinkElement.prototype, 'href');
patchProperty(win.HTMLImageElement && HTMLImageElement.prototype, 'src');
patchProperty(win.HTMLIFrameElement && HTMLIFrameElement.prototype, 'src');
patchProperty(win.HTMLSourceElement && HTMLSourceElement.prototype, 'src');
patchFetch();
patchXmlHttpRequest();
patchSendBeacon();
startObserver();
win.__digitalFeedbackBlocker = {
shouldBlockUrl: shouldBlockUrl,
isBlockingEnabled: function() {
return blockerState.enabled;
},
setBlockingEnabled: setBlockingEnabled,
cleanupBlockedNodes: function(root) {
cleanupBlockedNodes(root || doc);
}
};
setBlockingEnabled(getPersistedNewVersion() === false);
if (!blockerState.enabled) {
appendResourceHint('dns-prefetch', '//digitalfeedback.us.confirmit.com');
}
}
install();
})(window, document);CommunityForums.initCommunityLmd();window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-ELYCWL3S4C');
$(function() {
mt_user.signInLoad();
});
window.inlineLena = {
url: "https://us-llm.lena.lenovo.com/inline/js/kd-bot-plugins.umd.cjs",
env: "PROD",
}
if(!window.config)window.config={};
if(!window.config.realms)window.config.realms={"ALL":{"Brands":["EBG","TPG","IPG","MOTO","PHONE","TABLET","SMART","FCCL"],"CountryCatalog":true,"DefaultSiteUrl":"https://support.lenovo.com","Id":"Realm.ALL","IsFallbackContent":false,"IsFallbackSitecore":false},"EBG":{"Brands":["EBG"],"CountryCatalog":false,"DefaultSiteUrl":"https://datacentersupport.lenovo.com","Id":"Realm.DCG","IsFallbackContent":true,"IsFallbackSitecore":false},"PHONE":{"Brands":["PHONE"],"CountryCatalog":false,"DefaultSiteUrl":"https://lenovomobilesupport.lenovo.com","Id":"Realm.MBG","IsFallbackContent":false,"IsFallbackSitecore":false},"MOTO":{"Brands":["MOTO"],"CountryCatalog":true,"DefaultSiteUrl":"https://support.motorola.com","Id":"Realm.MOTO","IsFallbackContent":true,"IsFallbackSitecore":true},"TABLET":{"Brands":["TABLET","TPG","IPG","FCCL"],"CountryCatalog":true,"DefaultSiteUrl":"https://pcsupport.lenovo.com","Id":"Realm.PCG","IsFallbackContent":false,"IsFallbackSitecore":false},"TPG":{"Brands":["TABLET","TPG","IPG","FCCL"],"CountryCatalog":true,"DefaultSiteUrl":"https://pcsupport.lenovo.com","Id":"Realm.PCG","IsFallbackContent":false,"IsFallbackSitecore":false},"IPG":{"Brands":["TABLET","TPG","IPG","FCCL"],"CountryCatalog":true,"DefaultSiteUrl":"https://pcsupport.lenovo.com","Id":"Realm.PCG","IsFallbackContent":false,"IsFallbackSitecore":false},"FCCL":{"Brands":["TABLET","TPG","IPG","FCCL"],"CountryCatalog":true,"DefaultSiteUrl":"https://pcsupport.lenovo.com","Id":"Realm.PCG","IsFallbackContent":false,"IsFallbackSitecore":false},"SMART":{"Brands":["SMART"],"CountryCatalog":false,"DefaultSiteUrl":"https://smartsupport.lenovo.com","Id":"Realm.SMART","IsFallbackContent":false,"IsFallbackSitecore":false}};window._satellite && window._satellite.pageBottom();if(!window['caps_configurations']) window['caps_configurations']={};$(function() {
var lsbV5 = document.createElement('script');
lsbV5.type = 'text/javascript'; lsbV5.async = 1;
var currentDay = new Date().format('yyyy-MM-dd');
lsbV5.src = "https://pcsupport.lenovo.com/esv4/plugins/lsbv5/lsbv5.js" + '?v='+currentDay;
var d = document.getElementsByTagName('script')[0];
!window.LSBV5 && d.parentNode.insertBefore(lsbV5, d);
});function fixTabindex() {
var nodes = document.querySelectorAll('[tabindex]');
nodes.forEach(function(node) {
var val = parseInt(node.getAttribute('tabindex'), 10);
if (val > 0) {
node.setAttribute('tabindex', '0');
}
});
}
document.addEventListener('DOMContentLoaded', function() {
fixTabindex();
// 监听DOM变化,动态修正tabindex
var observer = new MutationObserver(function() {
fixTabindex();
});
observer.observe(document.body, { childList: true, subtree: true });
});(function(e){function r(r){for(var n,l,i=r[0],a=r[1],f=r[2],c=0,s=[];c
x server