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

Script issues/breakage [Firefox only][Violentmonkey latest update v2.12.8][incl. workaround] #48

Closed
bunkhub opened this issue Dec 29, 2020 · 4 comments

Comments

@bunkhub
Copy link

bunkhub commented Dec 29, 2020

What is the problem?

Just noticed with the latest update (v2.12.8) for ViolentMonkey in Firefox, that the LTKDIFMU-userscript is not functioning correctly (with default settings). There are no issues in Chromium based browsers as far as I can tell. I verified this on multiple versions of Windows using the latest Firefox ESR channel.

Note: Suggested workaround included at the end of this post. I felt it should be appropriate to note the issue here, for anyone else that might be experiencing the same issue.

At first I was under the presumption that maybe the issue was due to ViolentMonkey, and I opened an issue with the associated developer/github page here. However, @tophf suggested that ViolentMonkey is working appropriately, and instead suggested some further explanations which might give some insight towards LTKDIFMU-userscript compatibility: response 1, response 2

How to reproduce it?

  1. Install Firefox ESR http://www.mozilla.org/en-US/firefox/organizations/all.html
  2. Install or update ViolentMonkey to v2.12.8 (in Firefox), grant the extension whatever permissions it needs
  3. Install LTKDIFMU-userscript
  4. Navigate the internet, with Firefox, to any of the destination sites supported from the LTKDIFMU userscript (all are affected).

What is the expected result?

When the script has been initialized, any trial banners are removed from the page, new buttons/functions are added on the control bar at the bottom of the page, and it prompts with a short notification (in page) that says "DIUserscript: Enjoy free uninterrupted music and enhanced features"

What is the actual result?

The script basically does not load nor function. No functions of the script appear to be injected. The 'Start Free Premium Trial' banner remains in the header, none of the buttons/functions the script adds are loaded, and there is no notification from the script that it has even initialized.

As noted above, everything appears to be functioning correctly in Chromium based browsers (with the latest version of ViolentMonkey using default settings), AND when downgrading to the previous v2.12.7 release (in Firefox only) everything appears to be functioning correctly as well.

Workaround

Following suggestion from @tophf, per response 2 manually changing the 'run-at' settings for the userscript in ViolentMonkey to 'document-end' appears to resolve the issue for the time being.

Edit note: originally stated that manually setting the 'document-start' variable, OR 'document-end' both worked - this is incorrect, as I lost track of which version of the extension I was working with across different browser installations (my mistake). ONLY 'document-end' works with v2.18.8. So I edited this post to reflect that change. However, I have not tested all features - it appears to mostly be working correctly albeit a minor GUI issue with the volume slider. I might try the latest beta of ViolentMonkey soon for the run at 'document-body' variable (also suggested by @tophf)

Environment

  • Browser: Firefox ESR
  • Browser version: 78.6.0esr
  • Violentmonkey version: 2.12.8
  • OS: Win7sp1 / Win10 1809-20H2 Home/Pro (x64)
@lethak
Copy link
Owner

lethak commented Dec 29, 2020

Hi, thanks for pointing this out.
Will take a look at it before next release.
No date tho

The only thing I am sure at the moment is that some features won't work as intended if the userscript's code is not injected before anything else.

@lethak
Copy link
Owner

lethak commented Apr 7, 2021

The only feature I found not working when starting as "document-end" with VM/FF

  • Play tracks (hero page + "Likes" page)

Workaround

I am going to say the only 100% working workaround now is to use Tempermonkey and not Violentmonkey until this is fixed.

Also Tempermonkey has to be setup with "Inject Mode: Default"

@lethak
Copy link
Owner

lethak commented Apr 7, 2021

Investigation

It appears @tophf was right and the way I instantiated some Vue components had Webpack inject styles and code into the DOM prior to the DOM existing at all.

A fix is ready and will be in the next release.
Tested with Chrome, FF, VM, and TM with and without 'Instant' mode.

Therefore, 'document-start' should be used again after that !

lethak added a commit that referenced this issue Apr 8, 2021
…v2021.4.43)

All platforms:
* Misc (VueJS): Fixed component inclusion to prevent webpack from injecting the DOM prior to the DOM existing at all. (issue #48)
* Player (track download button): Fixed some edge cases preventing the download button from working as intended. (issue #50)
* Player (track play): The ability to play a track from its hero or favorite page is now toggleable in the userscript's settings. It was
previously forced on.
* Player (track play): Implemented a new feature to always play a track from the beginning (toggleable). (issue #51)
* Misc (js errors): Fixed some javascript errors triggered when using deprecated API values.

di-only:
* Navigation (UI): Fixed the "DIUserscript" menu entries & removed the "Go Premium" one (issue #52)
* Player (volume input control): Fixed CSS since its now vertical instead of horizontal (issue #46). Its still slightly ugly but its working.
@lethak
Copy link
Owner

lethak commented Apr 8, 2021

Released version v2021.4.43 fixed this.
Therefore, 'document-start' should be used again.

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

No branches or pull requests

2 participants