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

Uncaught TypeError when not logged in to Wordpress #3

Open
kevinblackdesk opened this issue Dec 4, 2020 · 0 comments · May be fixed by #4
Open

Uncaught TypeError when not logged in to Wordpress #3

kevinblackdesk opened this issue Dec 4, 2020 · 0 comments · May be fixed by #4

Comments

@kevinblackdesk
Copy link

When I am not logged in to my Wordpress site, this extension will throw an error when you have a saved state for that website in your local storage (or when you click on it again).

VM50:1 Uncaught TypeError: Cannot read property 'style' of null
    at <anonymous>:1:38
(anonymous) @ VM50:1
VM51:1 Uncaught TypeError: Cannot read property 'style' of null
    at <anonymous>:1:38
(anonymous) @ VM51:1
VM53:1 Uncaught TypeError: Cannot read property 'style' of null
    at <anonymous>:1:38

This is because this extension tries to apply style to an element that is not existing on the page.

Steps to reproduce error(s):

  1. Visit Wordpress website
  2. Click on this extension's icon to hide the Wordpress admin bar
  3. Log out of that Wordpress website
  4. Look at Chrome Developer Console
kevinblackdesk added a commit to kevinblackdesk/wpAdminBarHide that referenced this issue Dec 4, 2020
Fixes EranSch#3, also I've changed the code block from `[].join('')` to backquotes/backticks since that allows us to write multiple lines of Javascript code and it will be treated as a single string for the `code` property.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant