Không sử dụng trình nghe bị động để cải thiện hiệu suất cuộn

BỆNH ĐAU THẮT LƯNG
June 11, 2020
XEM HẾT 30 VIDEO TRIỆU VIEW NÀY, CUỘC SỐNG CỦA BẠN SẼ KHÁC HẲN!
July 20, 2020

Vài hôm nay em có tối ưu tốc vài web và nhận thấy là google mới thêm một mục đánh giá web mới đó là Không sử dụng trình nghe bị động để cải thiện hiệu suất cuộn. Lúc đầu em cũng không hiểu là gì và cũng không biết khác phục ra sao. Em liền đi dạo một vòng google và thấy có một bác đã chia sẽ cách khắc phục từ năm 2017. Em liền thêm thử đoạn code javascript mà bác đó chưa sẽ vào web và kết quả ngoài mong đợi. google đã chấm xanh mục đó.
Mọi người chỉ cần chèn đoạn code sau vào file functions.php của Child Theme và xóa hết cache, xóa các file nén js. Rồi lên https://developers.google.com/speed/pagespeed/insights/ kiểm tra lại

 

function add_script_fix_devgg(){ ?>
<script>
(function() {
var supportsPassive = eventListenerOptionsSupported();

if (supportsPassive) {
var addEvent = EventTarget.prototype.addEventListener;
overwriteAddEvent(addEvent);
}

function overwriteAddEvent(superMethod) {
var defaultOptions = {
passive: true,
capture: false
};

EventTarget.prototype.addEventListener = function(type, listener, options) {
var usesListenerOptions = typeof options === 'object';
var useCapture = usesListenerOptions ? options.capture : options;

options = usesListenerOptions ? options : {};
options.passive = options.passive !== undefined ? options.passive : defaultOptions.passive;
options.capture = useCapture !== undefined ? useCapture : defaultOptions.capture;

superMethod.call(this, type, listener, options);
};
}

function eventListenerOptionsSupported() {
var supported = false;
try {
var opts = Object.defineProperty({}, 'passive', {
get: function() {
supported = true;
}
});
window.addEventListener("test", null, opts);
} catch (e) {}

return supported;
}
})();
</script>
<?php }

add_action('wp_footer', 'add_script_fix_devgg');

 

Nguồn: https://stackoverflow.com/questions/45974128/wordpress-and-best-practice-with-passive-event-listeners

591 Comments

  1. Kdilfy says:

    ivermectin 0.2mg – cost of ivermectin lotion ivermectin over counter

  2. Dcmbfu says:

    ventolin purchase – ventolin australia price buy albuterol online

  3. Cqdbnh says:

    cytotec 200mg tablet – where to buy cytotec online in canada cytotec tablet price

  4. Hgxsxv says:

    where to buy doxycycline 100mg – cheapest 40 mg doxycycline doxycycline 50mg tablets price

  5. Qydjde says:

    neurontin 600 mg coupon – brand name neurontin price levothyroxine no prescription

  6. viagra joke says:

    cialis 10 mg receta

  7. Awidml says:

    sildenafil sale uk – name brand viagra online how to buy viagra online canada

  8. Pqfnxk says:

    cialis generic canadian – brand cialis canadian pharmacy generic cialis 40 mg

  9. Dpyeva says:

    online vardenafil uk – buy vardenafil online generic vardenafil usa

  10. Fluilacah says:

    https://buystromectolon.com/ – buy stromectol for humans in tijuana

  11. Propecia says:

    Kamagra 100 Chewable Tablet

  12. Kbkjho says:

    ivermectin 8000 – stromectol 6 mg

  13. Zecgtp says:

    how to get prednisone tablets – prednisone brand name deltasone price

  14. can you buy hydroxychloroquine over the counter trump hydroxychloroquine what is hydroxychloroquine 200 mg used for

  15. Jwyouv says:

    buy accutane 40 mg online – isotretinoin generic isotretinoin for sale

  16. Hasqul says:

    amoxicillin 500mg capsules – amoxclin amoxicillin without prescription

  17. Aqwljs says:

    medrol 32 – lyrica 75 mg price in usa buy lyrica australia

  18. Gnwwzl says:

    order research paper – custom made essays help with essay writing

  19. LesterFlurf says:

    buy medications online india pharmacy without dr prescriptions – ed products

  20. Unarronry says:

    http://buysildenshop.com/ – compare viagra cialis and levitra

  21. Vnthnr says:

    buy cheap viagra online in canada – Buy viagra cheap us over the counter viagra

  22. Hjjzit says:

    generic cialis 5mg canada – Buy cialis usa prices cialis

  23. nighorago says:

    http://buypropeciaon.com/ – online pharmacy finax

  24. KennethMoori says:

    ivermectin price cost of ivermectin pill – cost of ivermectin medicine

  25. Stromectol says:

    Buy Antibiotics Online Overnight

  26. KennethMoori says:

    ivermectin where to buy for humans buy ivermectin online – ivermectin 9 mg

  27. Btevqc says:

    prednisone 20mg tab price – prednisone pills for sale prednisone 20 mg tablet cost

  28. zithromax dosis zithromax how to take z pack indications

  29. Kvzcig says:

    furosemide 10 mg price – buy clomiphene furosemide rx 20 mg

  30. Tadalis Sx Soft Feminin Pharmacia

  31. Aoamij says:

    ventolin generic price – generic ventolin price cheap albuterol

  32. Ikqmrp says:

    where can i buy misoprostol – cytotec 0.8 mg daily cytotec pills

  33. hydroxychloroquine brand name can i buy chloroquine over the counter what is hydrochloroquine

  34. Zithromax says:

    Levitra Puede Fallar

  35. Ymyjkg says:

    doxycycline 300 mg daily – can you buy prednisolone over the counter in australia prednisolone cost usa

  36. Swiweem says:

    http://buypriligyhop.com/ – buy priligy reddit

  37. Nuaiwl says:

    stromectol cost – stromectol 12mg stromectol for sale

  38. Khgjnx says:

    ivermectin cost in usa – ivermectin india stromectol liquid

  39. Вас лишили водительского удостоверения
    ? Не знаете как быть и чем кормить семью?
    Есть решение, купить водительское удостоверение при лишении можно оформить в
    компании on-prava, предлагаются различные варианты решения данного вопроса, на любой вкус.
    Обращайтесь в он-права и решите вопрос лишения водительского
    удостоверения.
    Wilbur
    comment-311822 – Elouise – http://www.ecoindustry.ru/user/lishennym/gb.html

  40. Dunlicy says:

    http://buyplaquenilcv.com/ – plaquenil corona

  41. Jyusro says:

    generic tadalafil – tadalafil online pharmacy online tadalafil

  42. DanielRourl says:

    cheap tadalafil online tadalafil generic us – tadalafil 2.5 mg tablets india

  43. Nemenouh says:

    chloroquine vs hydroxychloroquine https://hydroxychloroquinex.com/ hydroxychloroquine sulfate tablets hydroxycloraquin

  44. Arjpcl says:

    accutane tablets buy online – accutane india cost how to buy accutane online

  45. Priligy says:

    Berichte Uber Levitra

  46. Mosjcx says:

    help with thesis – writing essays for money online assignment writer

  47. Bthvyk says:

    ivermectin pills for humans – buy ivermectin tablets stromectol 3 mg dosage

  48. DanielRourl says:

    cheap sildenafil from india india sildenafil – compare sildenafil prices

  49. Thomasbet says:

    ivermectin 1mg ivermectin for sale ivermectin topical

  50. Alfnbj says:

    viagra tablets india – best place buy viagra online generic cialis soft tabs

  51. hydroxychloroquine classification https://plaquenilx.com/# hydroxychloroquine sul

  52. Buy Cipro Online No Prescription

  53. Cwbtxh says:

    generic vardenafil reviews – levitra price how to cure ed

  54. Iiwasx says:

    vardenafil samples – canadian vet pharmacy cure ed

  55. does hydroxychloroquine require a prescription https://plaquenilx.com/# quinine vs hydroxychloroquine

  56. Zynmbw says:

    hydroxychloroquine study – generic plaquenil canada pharmacy deltasone

  57. Hpompy says:

    fildena – fildena 150 usa and uk buy cenforce 200 mg online with credit card

  58. chloroquine phosphate vs chloroquine sulphate https://pharmaceptica.com/

  59. Prednisone says:

    Buy Wellbutrin Xl In Uk

  60. Cuaodx says:

    orlistat medicine – generic xenical alli orlistat docking

  61. Sulfonamide antibiotic sulfamethoxazole trimethoprim side effects

  62. Anthonyrousa says:

    https://edcialislove.com/# cialis online in canada

  63. Zsityk says:

    ivermectin tablets uk – stromectol cost canada purchase ivermectin

  64. Anthonyrousa says:

    https://edcialislove.online# cialis with dapoxetine overnight delivery australia

  65. Ntnhfg says:

    get online prescription for viagra – sildenafil women cheap viagra online without prescription

  66. Knmvgv says:

    order cialis 2.5mg – firstcila.com cialis paypal

  67. […] safe place buy cialis online […]

  68. Rodolfostymn says:

    http://edviagralove.online# guaranteed viagra alternative
    viagra trial sample

  69. […] cialis online prescription […]

  70. industy says:

    https://prednisonebuyon.com/ – prednisolone 5mg tab

  71. unlifer says:

    https://buyneurontine.com/ – gabapentin does

  72. Zdlkzo says:

    tadalafil 2.5 mg – tadalafil tablets promo code for canadian pharmacy meds

  73. Rodolfostymn says:

    http://edviagralove.com/# how much is a bottle of viagra
    is cialis as effective as viagra

  74. Bcqbwu says:

    ivermectin goodrx – ivermectin us ivermectin 2ml

  75. Bddqvy says:

    ivermectin for covid – ivermectin for sale generic stromectol for humans

  76. Aitdxk says:

    buy sildenafil mexico – site best female viagra

  77. […] buy cialis hong kong […]

  78. […] viagra pills for cheap […]

  79. Jordanvop says:

    new treatments for ed canadian pharmacy – can ed be cured

  80. Vpikpc says:

    best price for sildenafil medicine – viagra online prescription cheap viagra australia fast delivery

  81. gazbuighew says:

    It’s really very difficult in this busy life to listen news on Television, thus I only use world wide web for that purpose,
    and obtain the newest news.

  82. […] buy viagra and cialis online […]

  83. Dttymc says:

    buy cialis 5mg uk – generic cialis online tadalafil 5mg costs

Leave a Reply

Your email address will not be published.

Buy now

Login

Lost your password?