Coder Social home page Coder Social logo

chrome-extension-code-injector's Introduction

About

The primary thing I want RIGHT NOW as I make this is a CSS injector for YouTube. Yes these exist but I would rather have my own that I trust(tin foil hat engaged). For YouTube I want to hide the home tiles because everytime I go to YouTube with an intent to do something my mind gets hijacked by the random shit on there. Usually I use YouTube to look up a specific video eg. music or put on some playlist.

I will add other functionality eg. adding JS/interfaces/etc... to specific websites by domain, this is not an original idea there is a pretty cool extension I briefly used that was specifically for injecting custom JS by domains. I just as I mentioned "want my own".

How to use

This is not a packaged extension, you have to run this in developer mode. Clone this repo then in the Extensions page use Load unpacked and select this folder.

How it works

As a quick TL;DR on how Chrome Extensions work which I'm not an expert but what I learned to make this:

  • manifest.json is the starting point, in this case checks for YouTube url patterns
  • then if a match occurs injects the custom CSS/JS code which you can trace what files it loads, that's it, no background stuff going on in this extension
  • document_start means it runs right away, does not wait for DOM to load, this specifically is most important for CSS overriding so whatever gets loaded does not show its original style

Extension functionalities

YouTube lander recommended tiles hiding mod

Disclaimer

I only tested this/intend to use it for a resolution of around/at least 1600px or so...

Post build/attempt actual

This shows the tiles being hidden on load, can click to show them again. Other pages eg. search don't have this class applied as the generic primary id exists on other pages. I may have to update the scripts exclude_matches array as I find other YouTube urls I use that are affected by that global CSS override.

gif of current YouTube landing page mod

This is what I'll have something like this, I'm hoping the injection is fast enough but usually with custom embedded stuff it's not fast enough(brief ugly white flash).

modified YouTube interface

I tried a few ways to add the custom HTML, whenever it gets added the page seems to just break. Yeah seems this thing called webcomponents-sd.js tries to remove it.

error from custom html

See DEVLOG for more info

References

chrome-extension-code-injector's People

Contributors

jdc-cunningham avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.