Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

npx grunt build fails: "Required config property "copy.undefined" missing #13

Closed
doronbehar opened this issue Apr 7, 2019 · 5 comments

Comments

@doronbehar
Copy link
Contributor

I would like to contribute a connector for https://invidio.us, it should be very similar to YouTube's. I get this error when running npx grunt build:

Running "build" task

Running "copy:undefined" (copy) task
Verifying property copy.undefined exists in config...ERROR
>> Unable to process task.
Warning: Required config property "copy.undefined" missing. Use --force to continue.

Aborted due to warnings.

I couldn't find any solution when searching the web for this error. I've worked around it though for my tests with Firefox by using npx grunt build:firefox instead.

I still thought you should know so you'll be able to fix the Gruntfile.js accordingly.

@f1u77y
Copy link
Owner

f1u77y commented Apr 7, 2019

Sorry, Gruntfile.js is a mess now. I'll try to fix it.

@doronbehar
Copy link
Contributor Author

Thanks. As for the invidio.us support I'd like to contribute, I was wondering whether you could help me a little bit getting inside the code. I have a question:

I'm trying to understand the way a connector works by reading the existing ones. As I see, the most important variables in a connector are the selectors I. If I give a selector (take nextButtonSelector for example) a value of div#continue and the first link inside it will lead to the next video, should it be good enough or should I find a selector that will lead straight to a link that targets the next video?

@f1u77y
Copy link
Owner

f1u77y commented Apr 7, 2019

If I give a selector (take nextButtonSelector for example) a value of div#continue and the first link inside it will lead to the next video, should it be good enough or should I find a selector that will lead straight to a link that targets the next video?

You could see content/base-connector.js to make a better idea of what happens there. In this case, when next signal comes from outside, connector.next() is called. Its implementation in base-connector.js among other things tries to get the first element that matches nextButtonSelector and then tries to call elem.click(). If there is no click()able element, you could just implement next() from scratch in your connector.

@f1u77y
Copy link
Owner

f1u77y commented Apr 7, 2019

I've also fixed Gruntfile.js and corresponding README info.

@doronbehar
Copy link
Contributor Author

I've also fixed Gruntfile.js and corresponding README info.

Cool.

You could see content/base-connector.js to make a better idea of what happens there. In this case, when next signal comes from outside, connector.next() is called. Its implementation in base-connector.js among other things tries to get the first element that matches nextButtonSelector and then tries to call elem.click(). If there is no click()able element, you could just implement next() from scratch in your connector.

Wonderfully explained. One more question please regarding the mediaSelector: I tried to set it to just video with the hope that it will eventually make the playPause() functions work just like in YouTube but it didn't work.

However, I've managed to test the addEventListener in the console like so:

document.querySelector('video').addEventListener("pause", function(){ console.log("paused")})

I've also tried to use playButtonSelector without success while I did managed to run this in the console:

document.querySelector('.vjs-play-control').click()

According to your explanation, both of these console tests should simulate what the extension does only with a few wrappers from content/utils.js right?

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

No branches or pull requests

2 participants