Skip to content

Power User Script fails with the error history is null #90

@fgierlinger

Description

@fgierlinger

What

The power user script fails with the error "history is null". On line 804 the variable history should be assigned with the #history element, but the is none such in the DOM of e.g. https://world.openfoodfacts.org/product/6111099000247

var history = document.getElementById("history");

Uncaught (in promise) TypeError: history is null
    window["__f__lsl0fzv4.kt9"]/</< moz-extension://b44e721e-003d-49fa-8d38-f046ab61ffb4/userscripts/Open-Food-Facts-power-user-script.user.js?id=fa8fc560-58ad-4b78-9bf9-c5916ff18b57:852
    window["__f__lsl0fzv4.kt9"]/< moz-extension://b44e721e-003d-49fa-8d38-f046ab61ffb4/userscripts/Open-Food-Facts-power-user-script.user.js?id=fa8fc560-58ad-4b78-9bf9-c5916ff18b57:2837
    Rt https://world.openfoodfacts.org/product/6111099000247:9
    window["__f__lsl0fzv4.kt9"]/< moz-extension://b44e721e-003d-49fa-8d38-f046ab61ffb4/userscripts/Open-Food-Facts-power-user-script.user.js?id=fa8fc560-58ad-4b78-9bf9-c5916ff18b57:1
    "__f__lsl0fzv4.kt9" moz-extension://b44e721e-003d-49fa-8d38-f046ab61ffb4/userscripts/Open-Food-Facts-power-user-script.user.js?id=fa8fc560-58ad-4b78-9bf9-c5916ff18b57:1
    Rt https://world.openfoodfacts.org/product/6111099000247:9
    o https://world.openfoodfacts.org/product/6111099000247:81
    <anonymous> https://world.openfoodfacts.org/product/6111099000247:84
    m https://world.openfoodfacts.org/product/6111099000247:78
6111099000247 line 9 > injectedScript:852:13

Steps to reproduce the behavior:

  1. Go to https://world.openfoodfacts.org/product/6111099000247
  2. Open Web Developer Tools and inspect the error
  3. Try to get DOM by manually executing document.getElementById("history") in the web console. null is returned.

Expected behavior

Power User Script should work in all cases

Platform (Desktop, Mobile, Hunger Games)

  • OS: macOS Ventura 13.2.1
  • Platform: Desktop
  • Browser: Firefox 115.7.0esr
  • Tampermonkey: v5.0.1
  • OpenFoodFacts Version: 2024-02-02T20:39

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions