Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
chrome.zip
firefox.zip
.DS_Store
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
build: chrome.zip
.PHONY: all clean

chrome.zip: manifest.json newlove.user.js
zip chrome.zip manifest.json newlove.user.js
all: chrome.zip firefox.zip

chrome.zip: manifest.json newlove.user.js browser-polyfill.js
zip -r chrome.zip manifest.json newlove.user.js browser-polyfill.js

firefox.zip: manifest.json newlove.user.js browser-polyfill.js
zip -r firefox.zip manifest.json newlove.user.js browser-polyfill.js

clean:
rm -f chrome.zip firefox.zip
22 changes: 22 additions & 0 deletions browser-polyfill.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Cross-browser compatibility layer
(function(global, factory) {
if (typeof chrome !== 'undefined') {
// Chrome uses the chrome.* namespace
global.browser = {
storage: {
local: {
get: (keys) => chrome.storage.local.get(keys),
set: (items) => chrome.storage.local.set(items),
remove: (keys) => chrome.storage.local.remove(keys)
}
}
};
} else if (typeof browser !== 'undefined') {
// Firefox already has the browser.* namespace
global.browser = browser;
}

// Dispatch an event to notify that the polyfill is ready
const event = new Event('browser-polyfill-ready');
global.dispatchEvent(event);
})(typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : this);
26 changes: 25 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
{"manifest_version":2,"version":"1.3.3","name":"GrinnellPlans NewLove","description":"Shows only new planlove in the quicklove page.","content_scripts":[{"matches":["*://*.grinnellplans.com/search.php?mysearch=*&planlove=1*"],"js":["newlove.user.js"]}],"permissions":["*://*.grinnellplans.com/search.php?mysearch=*&planlove=1*"]}
{
"manifest_version": 3,
"name": "GrinnellPlans NewLove",
"version": "2.0.0",
"description": "Shows only new planlove in the quicklove page.",
"browser_specific_settings": {
"gecko": {
"id": "newlove@grinnellplans.com",
"strict_min_version": "109.0"
}
},
"permissions": [
"storage"
],
"host_permissions": [
"*://*.grinnellplans.com/*"
],
"content_scripts": [{
"matches": ["*://*.grinnellplans.com/search.php?mysearch=*&planlove=1*"],
"js": ["browser-polyfill.js", "newlove.user.js"]
}],
"action": {
"default_title": "GrinnellPlans NewLove"
}
}
Loading