Skip to content

Instantly share code, notes, and snippets.

View alejandrocoding's full-sized avatar
🏠
Working from home

Alejandro Lora alejandrocoding

🏠
Working from home
View GitHub Profile
@alejandrocoding
alejandrocoding / background.ts
Created June 12, 2020 17:59
Chrome extension background.ts sample to filter out by github.com domain
chrome.runtime.onInstalled.addListener(() => {
chrome.webNavigation.onCompleted.addListener(() => {
chrome.tabs.query({ active: true, currentWindow: true }, ([{ id }]) => {
chrome.pageAction.show(id);
});
}, { url: [{ urlMatches: 'https://github.com/' }] });
});
@alejandrocoding
alejandrocoding / angular.json5
Last active June 12, 2020 17:04
Angular json file with the manifest.json added in the assets array of the build-options configuration
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
...
"projects": {
"chrome-extension-template": {
...
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
...
@alejandrocoding
alejandrocoding / manifest.json
Created June 12, 2020 16:34
Minimal version of manifest.json for Chrome Extensions Apps
{
"name": "My Extension",
"version": "1.0.0",
"description": "Description here",
"manifest_version": 2,
"permissions": ["webNavigation", "tabs"]
}