Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
fgierlinger opened this issue Feb 13, 2024 · 1 comment
Closed

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

fgierlinger opened this issue Feb 13, 2024 · 1 comment

Comments

@fgierlinger
Copy link

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
@CharlesNepote
Copy link
Member

Fixed, thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants