matthewhadley / chromedotfiles Goto Github PK
View Code? Open in Web Editor NEWa dotjs alternative, inject js and css into chrome tabs
License: MIT License
a dotjs alternative, inject js and css into chrome tabs
License: MIT License
Hey,
it doesn't work on the latest Chrome Build (90.0.4430.93) (Official Build) (64-Bit).
I followed the instruction steps and tried creating the 2 example files just as you did but neither of them caused any difference on google.com
Greetings,
ars4l4n
I use something similar on Safari, and wondered if there was a central repo for shared scripts and styles?
A bit like userscripts.org was for those things.
How can I access the window
object of the top frame? The Chrome dotfiles content script has its own window
object and window.top
doesn't return the window
of the top frame.
I want to do the following for Sharepoint because they open every freaking link in a new browser tab (second part works fine, but they use javascript/window.open
for some of the links):
window.open = url => location.href = url
for (const a of document.querySelectorAll('a')) {
a.removeAttribute('target')
}
I'm playing with the CSS injection and added this to a github.com.css
file:
body {
background-color: #F00;
}
But it had no effect. looking at the Elements tab in chrome, I see that it's inserted before the page's CSS
So how do I override existing CSS? Shouldn't appending the CSS be the default? Or maybe there could be a github.com.append.css
file that is treated differently at the very least?
Adding console.log to background.js
, when going to create this issue it says:
// i'm logging here
tab: https://github.com/diffsky/chromedotfiles/issues/new
match: Object {protocol: "https:", host: "github.com", hostname: "github.com", port: undefined, pathname: "/diffsky/chromedotfiles/issues/new"…}
// chrome throws these errors
extensions::sendRequest:82 Unchecked runtime.lastError while running tabs.insertCSS: Failed to load file: "chromedotfiles/github.com.css".
at chrome-extension://hocrtbokejcqajcfomloelehcgookikb/background.js:23:17
extensions::sendRequest:82 Unchecked runtime.lastError while running tabs.executeScript: Failed to load file: "chromedotfiles/github.com.js".
at chrome-extension://hocrtbokejcqajcfomloelehcgookikb/background.js:26:17
I tried placing a file in 2 different places to see if it'd work, but doesn't seem to:
~/.chromedotfiles/github.com.js
~/chromedotfiles/github.com.js
Is there any other setup I have to do? Do you have to do anything with certificates like with dotjs?
Does it depend on a specific version of chrome or operating system? I haven't updated my mac in a while, still using 10.9.2, not sure if that's a problem.
Would love to get this working :)
I just needed a lot of time to figure out, that the description of the addon saying place files to ~/.chromedotfiles/{domain}.(js|css) is wrong. You should change this (stored int the manifest.json) and the description of the repository (on GitHub just below the tabs) to something like {repository}/chromedotfiles/{domain}.(js|css)
so it matches what your README says.
First off, thank you for your work on this.
I forked the project and made a few improvements you might be interested in.
works the same as default.js
CSS is now applied instantaneously. No more visible delay.
can now organize your files and load vendors without having everything meshed into one file.
Example:
// load dependencies in that exact order
loadJS(['vendor/jquery.js', 'vendor/jquery-time-ago.js', 'vendor/underscore.js']);
// load and execute my callback
loadJS('vendor/jquery.js', "callback");
function callback() {}
// load and execute my callback in namespace
loadJS('vendor/jquery.js', 'App.callback');
var App = {
callback: function() {
}
};
Update readme to explain changes + added example directory
Pick and choose whatever you wanna pull into your repo.
Forked here https://github.com/hbt/chromedotfiles
Take care
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.