Skip to content
This repository has been archived by the owner on Jun 19, 2022. It is now read-only.

Extensions implementation #50

Closed
webdev03 opened this issue Dec 16, 2021 · 64 comments
Closed

Extensions implementation #50

webdev03 opened this issue Dec 16, 2021 · 64 comments

Comments

@webdev03
Copy link
Contributor

I think that ninetails should have an implementation of extensions (it just is necessary in a web browser) but the main problem with this is the rules on Scratch that disallow mentioning extensions. If this can be overcome, it would be awesome to have an adblocker on Ninetails!

@MystPi
Copy link
Owner

MystPi commented Dec 16, 2021

I honestly don't know how to do this. You can try your hand at it if you want.

@ninjamar
Copy link

I would love to have Scratch Addons on ninetails.

@webdev03
Copy link
Contributor Author

wait so we can mention sa?

@MystPi
Copy link
Owner

MystPi commented Dec 16, 2021

wait so we can mention sa?

I don't think you're supposed to, but I don't care if you do.

@webdev03
Copy link
Contributor Author

WebExtensions would be kind of hard to implement though.

@ninjamar
Copy link

We could start small with something like userscripts.

@webdev03
Copy link
Contributor Author

webdev03 commented Dec 16, 2021

Yeah, that would be a good idea. Just something that can be run as normal JS code like it was in the webview. Or maybe give some permission to access Electron API?

@ninjamar
Copy link

How about we can do some script injecting then work out way up to the electron api.

@ninjamar
Copy link

ninjamar commented Dec 17, 2021

I'll try to figure out a way to inject scripts inside a page.

@webdev03
Copy link
Contributor Author

Okay !

@ninjamar
Copy link

https://github.com/ninjamar/ninetails
I added the base of an extension loader (it can load from urls) but I am not good at the ui stuff.

@ninjamar
Copy link

@MystPi could you help with the ui on my fork?

@ninjamar
Copy link

@MystPi
Copy link
Owner

MystPi commented Dec 17, 2021

Nice! Please make sure you're using 2 spaces for tabs, instead of 4.

@MystPi
Copy link
Owner

MystPi commented Dec 17, 2021

MystPi could you help with the ui on my fork?

What type of UI do you want for it?

@MystPi
Copy link
Owner

MystPi commented Dec 17, 2021

There are actually pre-built functions for injecting styles into a webview. You should probably use it instead, as you can also remove the injected style.

webview.insertCSS and webview.removeInsertedCSS: https://www.electronjs.org/docs/latest/api/webview-tag#webviewinsertcsscss

@ninjamar
Copy link

MystPi could you help with the ui on my fork?

What type of UI do you want for it?

Could you add a userscript/userstyle settings page so we can load them by url?

@ninjamar
Copy link

ninjamar commented Dec 17, 2021

There are actually pre-built functions for injecting styles into a webview. You should probably use it instead, as you can also remove the injected style.

webview.insertCSS and webview.removeInsertedCSS: https://www.electronjs.org/docs/latest/api/webview-tag#webviewinsertcsscss

What about scripts? Should I use webview.executeJavaScript?

@MystPi
Copy link
Owner

MystPi commented Dec 17, 2021

There are actually pre-built functions for injecting styles into a webview. You should probably use it instead, as you can also remove the injected style.
webview.insertCSS and webview.removeInsertedCSS: https://www.electronjs.org/docs/latest/api/webview-tag#webviewinsertcsscss

What about scripts? Should I use webview.executeJavaScript?

I don't really know. Possibly?

@ninjamar
Copy link

There are actually pre-built functions for injecting styles into a webview. You should probably use it instead, as you can also remove the injected style.
webview.insertCSS and webview.removeInsertedCSS: https://www.electronjs.org/docs/latest/api/webview-tag#webviewinsertcsscss

What about scripts? Should I use webview.executeJavaScript?

I don't really know. Possibly?

I'll mess around with it.

@ninjamar
Copy link

Should https be used by default? I'm using #66 (comment)
Should we host the proxy on startup locally?

@hello-smile6
Copy link
Contributor

Should https be used by default? I'm using #66 (comment) Should we host the proxy on startup locally?

Replit only allows HTTPS.

@webdev03
Copy link
Contributor Author

What do you mean by https by default?

@Mbrick2
Copy link

Mbrick2 commented Dec 21, 2021

Maybr an enbedded ad/tracker blocker likr brave

@ninjamar
Copy link

ninjamar commented Dec 21, 2021

Maybr an enbedded ad/tracker blocker likr brave

We should have a userscript/userstyle library

@hello-smile6
Copy link
Contributor

hello-smile6 commented Dec 29, 2021

Should https be used by default? I'm using #66 (comment) Should we host the proxy on startup locally?

If you enable nodeIntegration and make sure you're careful with user data, you could use node-fetch.

@webdev03
Copy link
Contributor Author

You can inject CSS and JS into the webview.

@webdev03
Copy link
Contributor Author

Unfortunately you can't get access to the DOM 😭

@hello-smile6
Copy link
Contributor

Unfortunately you can't get access to the DOM 😭

Yes, you can. Just figure out how to run code in the renderer process as the webpage.

@hello-smile6

This comment has been minimized.

@hello-smile6
Copy link
Contributor

@hello-smile6 @webdev03 can someone help ^^

Not sure, and haven't even installed NodeJS yet.

can you install it ?

Fine. 🙄 That other comment was accidental. Hit Ctrl+Enter at the wrong time.

@webdev03
Copy link
Contributor Author

webdev03 commented Jan 3, 2022

That looks like it should work while I was browsing the code.

@ninjamar
Copy link

ninjamar commented Jan 3, 2022

That looks like it should work while I was browsing the code.

can you check on your computer?
i'm running popos 21.04 , node 17.3.0

@hello-smile6
Copy link
Contributor

That looks like it should work while I was browsing the code.

can you check on your computer? i'm running popos 21.04 , node 17.3.0

Just installed nodejs 16.x

@webdev03
Copy link
Contributor Author

webdev03 commented Jan 3, 2022

You have node 17?? I thought 16 was latest! Lol
You put ./extensions.js instead of ./js/extensions.js

@ninjamar
Copy link

ninjamar commented Jan 3, 2022

You have node 17?? I thought 16 was latest! Lol You put ./extensions.js instead of ./js/extensions.js

i copy/pasted the files from my computer but i hand did index.html - i fixed it but this wasn't the error i was talking about see the commit comment i made - https://github.com/ninjamar/ninetails/commit/b3f147d4f20dac54173e6961efea993738268fdc#commitcomment-62856323

@hello-smile6
Copy link
Contributor

@hello-smile6 @webdev03 can someone help ^^

Done installing, looking at it

@ninjamar
Copy link

ninjamar commented Jan 4, 2022

@hello-smile6 @webdev03 can someone help ^^

Done installing, looking at it

tnx

@hello-smile6
Copy link
Contributor

@hello-smile6 @webdev03 can someone help ^^

Done installing, looking at it

tnx

Gonna see if I can post from Firefox in a Ubuntu 10 v86 VM first.

@webdev03
Copy link
Contributor Author

webdev03 commented Jan 4, 2022

I'm working on an implementation in Catalyst right now.

@hello-smile6
Copy link
Contributor

I'm working on an implementation in Catalyst right now.

Nice! Could you by chance work on an Electron v86 client once you get that done? https://copy.sh/v86/

@ninjamar
Copy link

ninjamar commented Jan 5, 2022

@hello-smile6 status?

@webdev03
Copy link
Contributor Author

I think that Electron is working on native extensions support, but userscripts we could implement.

@ninjamar
Copy link

I think that Electron is working on native extensions support, but userscripts we could implement.

ok - can u review?

@ninjamar
Copy link

@MystPi can u help?

@MystPi
Copy link
Owner

MystPi commented Jan 13, 2022

@MystPi can u help?

Sure, what do you need help with?

@ninjamar
Copy link

@MystPi can u help?

Sure, what do you need help with?

#50 (comment)

@MystPi
Copy link
Owner

MystPi commented Jan 14, 2022

Okay, so first you should fetch upstream because you're 40 commits behind. Also you have a syntax error and a reference error:

image

@webdev03
Copy link
Contributor Author

bump

@hello-smile6
Copy link
Contributor

hello-smile6 commented Jan 23, 2022

bump

So? Life is bumpy! 😄

@MystPi
Copy link
Owner

MystPi commented Jan 23, 2022

I just found this: https://www.electronjs.org/docs/latest/api/extensions Maybe it will help.

@hello-smile6

This comment was marked as off-topic.

@webdev03
Copy link
Contributor Author

I just found this: https://www.electronjs.org/docs/latest/api/extensions Maybe it will help.

Would that be able to run in webview?

@hello-smile6

This comment was marked as off-topic.

@ninjamar
Copy link

I just found this: https://www.electronjs.org/docs/latest/api/extensions Maybe it will help.

Would that be able to run in webview?

That would work

@ninjamar
Copy link

I don't have time to do this anymore

@MystPi
Copy link
Owner

MystPi commented Feb 23, 2022

Okay.

@MystPi MystPi closed this as completed Feb 23, 2022
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

5 participants