XT release

This commit is contained in:
Tuxedo Takodachi 2023-04-30 16:04:01 +02:00
parent 2358ca2cd8
commit 486b0df990
29 changed files with 55349 additions and 84610 deletions

View File

@ -1,3 +1,23 @@
## 4chan XT changelog
4chan XT uses a different user script namespace, so to migrate you need to export settings from 4chan X, and import them
in XT.
### XT v2.0.0
#### 2023-04-30
This is the first XT release, which means this is after the migration from coffeescript to typescript, but there are
some other changes as well. These changes aren't in the upstream PR.
- Optimized image filters: filters are in a Map with the hash as key, instead of iterating over all image filters
- I removed font awesome to make the script smaller, and used unicode icons instead. This might break some user scripts
build in 4chan X that rely on them, and I only tested on windows.
- For even smaller user script size, there is a minified version available
- https://github.com/ccd0/4chan-x/pull/3352, fix for https://github.com/ccd0/4chan-x/issues/3349 was ported
## Original 4chan X changelog
**Note**: Installing the script from one of the links below will disable automatic updates. If you want automatic updates, install the script from the links on the [main page](https://www.4chan-x.net/).
-Sometimes the changelog has notes (not comprehensive) acknowledging people's work. This does not mean the changes are their fault, only that their code was used. All changes to the script are chosen by and the fault of the maintainer (ccd0).

336
Makefile
View File

@ -1,336 +0,0 @@
ifdef ComSpec
BIN := $(subst /,\,node_modules/.bin/)
RMDIR := -rmdir /s /q
RM := -del
CAT = type $(subst /,\,$1) > $(subst /,\,$2) 2>NUL
MKDIR = -mkdir $(subst /,\,$@)
QUOTE = $(patsubst %,"%",$1)
else
BIN := node_modules/.bin/
RMDIR := rm -rf
RM := rm -rf
CAT = cat $1 > $2
MKDIR = mkdir -p $@
QUOTE = $(patsubst %,'%',$1)
endif
CP = $(call CAT,$<,$@)
npgoals := clean cleanrel cleanweb cleanfull withtests archives $(foreach i,1 2 3 4,bump$(i)) tag tagcommit beta stable web update updatehard
ifneq "$(filter $(npgoals),$(MAKECMDGOALS))" ""
.NOTPARALLEL :
endif
coffee := $(BIN)coffee -c --no-header
template := node tools/template.js
template_deps := package.json tools/template.js
# read name meta_name meta_distBranch
$(eval $(shell node tools/pkgvars.js))
# must be read in when needed to prevent out-of-date version
version = $(shell node -p "JSON.parse(require('fs').readFileSync('version.json')).version")
source_directories := \
globals config css platform classes site \
Archive Filtering General Images Linkification \
Menu Miscellaneous Monitoring Posting Quotelinks \
main
# remove extension when sorting so X.coffee comes before X.Y.coffee
sort_directory = \
$(subst !c,.coffee,$(subst !j,.js,$(sort $(subst .coffee,!c,$(subst .js,!j, \
$(wildcard src/$1/*.coffee src/$1/*.js))))))
sources := $(foreach d,$(source_directories),$(call sort_directory,$(d)))
uses_tests_enabled := \
src/classes/Post.coffee \
src/General/Test.coffee \
src/Linkification/Linkify.coffee \
src/main/Main.coffee
imports_src/globals/globals.js := \
version.json
imports_src/css/CSS.js := \
node_modules/font-awesome/fonts/fontawesome-webfont.woff
imports_src/Monitoring/Favicon.coffee := \
src/meta/icon128.png
imports = \
$(filter-out %.coffee %.js,$(wildcard $(dir $1)*.*)) \
$(wildcard $(basename $1)/*.*) \
$(if $(filter $(uses_tests_enabled),$1),.tests_enabled) \
$(imports_$1)
dests_platform = $(addprefix tmp/,$(subst /,-,$(patsubst src/%,%.js,$(subst platform,platform_$2,$1))))
dests_of = $(sort $(call dests_platform,$1,crx) $(call dests_platform,$1,userscript))
dests := $(foreach s,$(sources),$(call dests_of,$(s)))
updates := $(subst tmp/,.events/,$(dests))
pieces = \
tmp/LICENSE \
tmp/meta-newline.js \
tmp/meta-fbegin.js \
tmp/meta-newline.js \
tmp/declaration.js \
tmp/meta-newline.js \
$(foreach s,$(sources),$(call dests_platform,$(s),$1)) \
tmp/meta-fend.js
crx_contents := script.js eventPage.js icon16.png icon48.png icon128.png manifest.json
release := \
$(foreach f, \
$(foreach c,. -beta.,$(name)$(c)crx updates$(c)xml updates$(c)json $(name)$(c)user.js $(name)$(c)meta.js) \
$(name)-noupdate.crx \
$(name)-noupdate.user.js \
$(name).zip \
,builds/$(f))
script := $(foreach f,$(filter-out %.crx %.zip,$(release)),test$(f)) $(foreach t,crx crx-beta crx-noupdate,$(foreach f,$(crx_contents),testbuilds/$(t)/$(f)))
crx := $(foreach f,$(filter %.crx %.zip,$(release)),test$(f))
default : script jshint install
all : default release
.events .events2 tmp testbuilds builds :
$(MKDIR)
.tests_enabled :
echo false> .tests_enabled
.events/declare : $(wildcard src/*/*.coffee) tools/declare.js | .events tmp
node tools/declare.js
echo -> $@
tmp/declaration.js : .events/declare
$(if $(wildcard $@),,node tools/declare.js && echo -> $<)
define check_source
$$(subst tmp/,.events/,$(call dests_of,$1)) : $1 $$(call imports,$1) | .events
echo -> $$(call QUOTE,$$@)
endef
$(foreach s,$(sources),$(eval $(call check_source,$(subst $$,$$$$,$(s)))))
.events/compile : $(updates) $(template_deps) tools/chain.js
node tools/chain.js $(call QUOTE, \
$(subst .events/,tmp/, \
$(if $(filter-out $(updates),$?), \
$(updates), \
$(filter $(updates),$?) \
) \
) \
)
echo -> $@
$(dests) : .events/compile
$(if $(wildcard $@),, \
node tools/chain.js $(call QUOTE, $(filter-out $(wildcard $(dests)),$(dests))) \
&& echo -> $< \
)
tmp/eventPage.js : src/meta/eventPage.coffee | tmp
$(coffee) -o tmp src/meta/eventPage.coffee
tmp/LICENSE : LICENSE tools/newlinefix.js | tmp
node tools/newlinefix.js $< $@
tmp/meta-%.js : src/meta/%.js tools/newlinefix.js | tmp
node tools/newlinefix.js $< $@
define rules_channel
testbuilds/crx$1 :
$$(MKDIR)
testbuilds/crx$1/script.js : $$(call pieces,crx) | testbuilds/crx$1 .events/compile
@echo Concatenating: $$@
@$$(call CAT,$$(call QUOTE,$$(call pieces,crx)),$$@)
testbuilds/crx$1/eventPage.js : tmp/eventPage.js | testbuilds/crx$1
$$(CP)
testbuilds/crx$1/icon%.png : src/meta/icon%.png | testbuilds/crx$1
$$(CP)
testbuilds/crx$1/manifest.json : src/meta/manifest.json version.json $(template_deps) | testbuilds/crx$1
$(template) $$< $$@ type=crx channel=$1
testbuilds/updates$1.xml : src/meta/updates.xml version.json $(template_deps) | testbuilds/crx$1
$(template) $$< $$@ type=crx channel=$1
testbuilds/updates$1.json : src/meta/updates.json version.json $(template_deps) | testbuilds/crx$1
$(template) $$< $$@ type=crx channel=$1
testbuilds/$(name)$1.crx.zip : \
$(foreach f,$(crx_contents),testbuilds/crx$1/$(f)) \
package.json version.json tools/zip-crx.js
node tools/zip-crx.js $1
testbuilds/$(name)$1.crx : $(foreach f,$(crx_contents),testbuilds/crx$1/$(f)) version.json tools/sign.sh | tmp
tools/sign.sh $1
testbuilds/$(name)$1.meta.js : src/meta/metadata.js src/meta/icon48.png version.json src/Archive/archives.json $(template_deps) | testbuilds
$(template) $$< $$@ type=userscript channel=$1
testbuilds/$(name)$1.user.js : testbuilds/$(name)$1.meta.js tmp/meta-newline.js $$(call pieces,userscript) | .events/compile
@echo Concatenating: $$@
@$$(call CAT,testbuilds/$(name)$1.meta.js tmp/meta-newline.js $$(call QUOTE,$$(call pieces,userscript)),$$@)
endef
$(eval $(call rules_channel,))
$(eval $(call rules_channel,-beta))
$(eval $(call rules_channel,-noupdate))
testbuilds/$(name).zip : testbuilds/$(name)-noupdate.crx.zip
$(CP)
builds/% : testbuilds/% | builds
$(CP)
test.html : README.md template.jst tools/markdown.js
node tools/markdown.js
index.html : test.html
$(CP)
tmp/.jshintrc : src/meta/jshint.json tmp/declaration.js src/globals/globals.js $(template_deps) | tmp
$(template) $< $@
.events/jshint : $(dests) tmp/.jshintrc
$(BIN)jshint $(call QUOTE, \
$(if $(filter-out $(dests),$?), \
$(dests), \
$(filter $(dests),$?) \
) \
)
echo -> $@
install.json :
echo {}> $@
.events/install : $(script) install.json tools/install.js | .events
node tools/install.js
echo -> $@
.events/CHANGELOG : version.json | .events
node tools/updcl.js
echo -> $@
dist :
git worktree add $@ $(meta_distBranch)
$(wildcard dist/* dist/*/*) : dist
@
distready : dist $(wildcard dist/* dist/*/*)
cd dist && git checkout $(meta_distBranch)
cd dist && git pull
.events2/push-git : .git/refs/heads .git/refs/tags $(wildcard .git/refs/heads/* .git/refs/tags/*) | .events2 distready
git push origin --tags -f
git push origin --all
echo -> $@
.events2/push-web : .git/refs/heads/$(meta_distBranch) | .events2 distready
git push web --tags -f
git push web $(meta_distBranch)
echo -> $@
.events2/push-store : .git/refs/tags/stable | .events2 distready
node tools/webstore.js
echo -> $@
.SECONDARY :
.PHONY: default all distready script crx release jshint install push $(npgoals)
script : $(script)
crx : $(crx)
release : $(release)
jshint : .events/jshint
install : .events/install
push : .events2/push-git .events2/push-web .events2/push-store
clean :
$(RMDIR) tmp tmp-crx testbuilds .events
$(RM) .tests_enabled
cleanrel : clean
$(RMDIR) builds
cleanweb :
$(RM) test.html
cleanfull : clean cleanweb
$(RMDIR) .events2 dist node_modules
git worktree prune
withtests :
echo true> .tests_enabled
-$(MAKE)
echo false> .tests_enabled
archives :
git fetch -n archives
git merge --no-commit -s ours archives/gh-pages
git show archives/gh-pages:archives.json > src/Archive/archives.json
-git commit -am 'Update archive list.'
$(foreach i,1 2 3 4,bump$(i)) :
$(MAKE) archives
node tools/bump.js $(subst bump,,$@)
$(MAKE) .events/CHANGELOG
$(MAKE) all
tag :
git add builds
$(MAKE) cleanrel
$(MAKE) all
git diff --quiet -- builds
$(MAKE) tagcommit
tagcommit :
git commit -am "Release $(meta_name) v$(version)."
git tag -a $(version) -m "$(meta_name) v$(version)."
beta : distready
git tag -af beta -m "$(meta_name) v$(version)."
cd dist && git merge --no-commit -s ours beta
cd dist && git checkout beta "builds/*-beta.*" img .gitignore .gitattributes
cd dist && git commit -am "Move $(meta_name) v$(version) to beta channel."
stable : distready
git push . HEAD:bstable
git tag -af stable -m "$(meta_name) v$(version)."
cd dist && git merge --no-commit -s ours stable
cd dist && git checkout stable "builds/$(name).*" builds/updates.xml builds/updates.json
cd dist && git commit -am "Move $(meta_name) v$(version) to stable channel."
web : index.html distready
-git commit -am "Build web page."
cd dist && git merge --no-commit -s ours master
cd dist && git checkout master README.md index.html web.css img .gitignore .gitattributes
cd dist && git commit -am "Update web page."
update :
$(RM) package-lock.json
npm install --save-dev $(shell node tools/unpinned.js)
npm install
updatehard :
$(RM) package-lock.json
npm install --save-dev $(shell node tools/unpinned.js latest)
npm install

View File

@ -1,6 +1,7 @@
# 4chan XT
**This repo is work in progress!** Use the build from the [repo this is forked from](https://github.com/ccd0/4chan-x) in the meantime.
I would prefer that this is merged into [the repo this is forked from](https://github.com/ccd0/4chan-x), but in the mean
time, you can try this fork as well.
PR to upstream: https://github.com/ccd0/4chan-x/pull/3341.
@ -20,8 +21,7 @@ The 4chan XT project is a migration of 4chan X from coffeescript to TypeScript/J
- [x] crx directory that can be loaded as an unpacked extension is created
- [x] beta
- [x] noupdate
- [ ] run and debug
- [ ] port updates made to 4chan-X made since this was forked
- [x] port updates made to 4chan-X made since this was forked
## Other notes
@ -61,6 +61,7 @@ The 4chan XT project is a migration of 4chan X from coffeescript to TypeScript/J
- [x] 7295b21b73eb13ec53fdc61767ada341c2e13144 Avoid breaking sauce settings of people with links to original Google Images and Google Lens, provided they didn't already update to v1.14.22.3.
- [x] 71873cd7b22a565c2a41fa24f63f7504152683eb Recognize JPEG files with .jfif extensions as images for purposes of Image Hover etc.; also recognize .avif and .jxl files as images.
- [x] ea2462ecc47327c6f0c31348d95fd2b1b6447cb3 Release 4chan X v1.14.22.4.
- [x] e31438f9a9907078508912fd4c4d44bf21ac773c Fix youtube /live embeds
</details>

Binary file not shown.

View File

@ -1,113 +0,0 @@
// ==UserScript==
// @name 4chan X beta
// @version 1.14.22.4
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
// @description 4chan X is a script that adds various features to anonymous imageboards.
// @license MIT; https://github.com/ccd0/4chan-x/blob/master/LICENSE
// @include http://boards.4chan.org/*
// @include https://boards.4chan.org/*
// @include http://sys.4chan.org/*
// @include https://sys.4chan.org/*
// @include http://www.4chan.org/*
// @include https://www.4chan.org/*
// @include http://boards.4channel.org/*
// @include https://boards.4channel.org/*
// @include http://sys.4channel.org/*
// @include https://sys.4channel.org/*
// @include http://www.4channel.org/*
// @include https://www.4channel.org/*
// @include http://i.4cdn.org/*
// @include https://i.4cdn.org/*
// @include http://is.4chan.org/*
// @include https://is.4chan.org/*
// @include http://is2.4chan.org/*
// @include https://is2.4chan.org/*
// @include http://is.4channel.org/*
// @include https://is.4channel.org/*
// @include http://is2.4channel.org/*
// @include https://is2.4channel.org/*
// @include https://erischan.org/*
// @include https://www.erischan.org/*
// @include https://fufufu.moe/*
// @include https://gnfos.com/*
// @include https://himasugi.blog/*
// @include https://www.himasugi.blog/*
// @include https://kakashinenpo.com/*
// @include https://www.kakashinenpo.com/*
// @include https://kissu.moe/*
// @include https://www.kissu.moe/*
// @include https://lainchan.org/*
// @include https://www.lainchan.org/*
// @include https://merorin.com/*
// @include https://ota-ch.com/*
// @include https://www.ota-ch.com/*
// @include https://ponyville.us/*
// @include https://www.ponyville.us/*
// @include https://smuglo.li/*
// @include https://notso.smuglo.li/*
// @include https://smugloli.net/*
// @include https://smug.nepu.moe/*
// @include https://sportschan.org/*
// @include https://www.sportschan.org/*
// @include https://sushigirl.us/*
// @include https://www.sushigirl.us/*
// @include https://tvch.moe/*
// @exclude http://www.4chan.org/advertise
// @exclude https://www.4chan.org/advertise
// @exclude http://www.4chan.org/advertise?*
// @exclude https://www.4chan.org/advertise?*
// @exclude http://www.4chan.org/donate
// @exclude https://www.4chan.org/donate
// @exclude http://www.4chan.org/donate?*
// @exclude https://www.4chan.org/donate?*
// @exclude http://www.4channel.org/advertise
// @exclude https://www.4channel.org/advertise
// @exclude http://www.4channel.org/advertise?*
// @exclude https://www.4channel.org/advertise?*
// @exclude http://www.4channel.org/donate
// @exclude https://www.4channel.org/donate
// @exclude http://www.4channel.org/donate?*
// @exclude https://www.4channel.org/donate?*
// @connect 4chan.org
// @connect 4channel.org
// @connect 4cdn.org
// @connect 4chenz.github.io
// @connect archive.4plebs.org
// @connect warosu.org
// @connect desuarchive.org
// @connect boards.fireden.net
// @connect arch.b4k.co
// @connect archived.moe
// @connect thebarchive.com
// @connect archiveofsins.com
// @connect www.tokyochronos.net
// @connect archive.palanq.win
// @connect eientei.xyz
// @connect api.clyp.it
// @connect api.dailymotion.com
// @connect api.github.com
// @connect soundcloud.com
// @connect api.streamable.com
// @connect vimeo.com
// @connect www.youtube.com
// @connect *
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue
// @grant GM_listValues
// @grant GM_addValueChangeListener
// @grant GM_openInTab
// @grant GM_xmlhttpRequest
// @grant GM.getValue
// @grant GM.setValue
// @grant GM.deleteValue
// @grant GM.listValues
// @grant GM.openInTab
// @grant GM.xmlHttpRequest
// @run-at document-start
// @updateURL https://www.4chan-x.net/builds/4chan-X-beta.meta.js
// @downloadURL https://www.4chan-x.net/builds/4chan-X-beta.user.js
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAF5JREFUeNrtkTESABAQxPD/R6tsE2dUGYUtFJvLDKf93KevHJAjpBorAQWSBIKqFASC4G0pCAkm4GfaEvgYXl0T6HBaE97f0vmnfYHbZOMLZCx9ISdKWwjOWZSC8GYm4SUGwfYgqI4AAAAASUVORK5CYII=
// ==/UserScript==

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -1,113 +0,0 @@
// ==UserScript==
// @name 4chan X
// @version 1.14.22.4
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
// @description 4chan X is a script that adds various features to anonymous imageboards.
// @license MIT; https://github.com/ccd0/4chan-x/blob/master/LICENSE
// @include http://boards.4chan.org/*
// @include https://boards.4chan.org/*
// @include http://sys.4chan.org/*
// @include https://sys.4chan.org/*
// @include http://www.4chan.org/*
// @include https://www.4chan.org/*
// @include http://boards.4channel.org/*
// @include https://boards.4channel.org/*
// @include http://sys.4channel.org/*
// @include https://sys.4channel.org/*
// @include http://www.4channel.org/*
// @include https://www.4channel.org/*
// @include http://i.4cdn.org/*
// @include https://i.4cdn.org/*
// @include http://is.4chan.org/*
// @include https://is.4chan.org/*
// @include http://is2.4chan.org/*
// @include https://is2.4chan.org/*
// @include http://is.4channel.org/*
// @include https://is.4channel.org/*
// @include http://is2.4channel.org/*
// @include https://is2.4channel.org/*
// @include https://erischan.org/*
// @include https://www.erischan.org/*
// @include https://fufufu.moe/*
// @include https://gnfos.com/*
// @include https://himasugi.blog/*
// @include https://www.himasugi.blog/*
// @include https://kakashinenpo.com/*
// @include https://www.kakashinenpo.com/*
// @include https://kissu.moe/*
// @include https://www.kissu.moe/*
// @include https://lainchan.org/*
// @include https://www.lainchan.org/*
// @include https://merorin.com/*
// @include https://ota-ch.com/*
// @include https://www.ota-ch.com/*
// @include https://ponyville.us/*
// @include https://www.ponyville.us/*
// @include https://smuglo.li/*
// @include https://notso.smuglo.li/*
// @include https://smugloli.net/*
// @include https://smug.nepu.moe/*
// @include https://sportschan.org/*
// @include https://www.sportschan.org/*
// @include https://sushigirl.us/*
// @include https://www.sushigirl.us/*
// @include https://tvch.moe/*
// @exclude http://www.4chan.org/advertise
// @exclude https://www.4chan.org/advertise
// @exclude http://www.4chan.org/advertise?*
// @exclude https://www.4chan.org/advertise?*
// @exclude http://www.4chan.org/donate
// @exclude https://www.4chan.org/donate
// @exclude http://www.4chan.org/donate?*
// @exclude https://www.4chan.org/donate?*
// @exclude http://www.4channel.org/advertise
// @exclude https://www.4channel.org/advertise
// @exclude http://www.4channel.org/advertise?*
// @exclude https://www.4channel.org/advertise?*
// @exclude http://www.4channel.org/donate
// @exclude https://www.4channel.org/donate
// @exclude http://www.4channel.org/donate?*
// @exclude https://www.4channel.org/donate?*
// @connect 4chan.org
// @connect 4channel.org
// @connect 4cdn.org
// @connect 4chenz.github.io
// @connect archive.4plebs.org
// @connect warosu.org
// @connect desuarchive.org
// @connect boards.fireden.net
// @connect arch.b4k.co
// @connect archived.moe
// @connect thebarchive.com
// @connect archiveofsins.com
// @connect www.tokyochronos.net
// @connect archive.palanq.win
// @connect eientei.xyz
// @connect api.clyp.it
// @connect api.dailymotion.com
// @connect api.github.com
// @connect soundcloud.com
// @connect api.streamable.com
// @connect vimeo.com
// @connect www.youtube.com
// @connect *
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue
// @grant GM_listValues
// @grant GM_addValueChangeListener
// @grant GM_openInTab
// @grant GM_xmlhttpRequest
// @grant GM.getValue
// @grant GM.setValue
// @grant GM.deleteValue
// @grant GM.listValues
// @grant GM.openInTab
// @grant GM.xmlHttpRequest
// @run-at document-start
// @updateURL https://www.4chan-x.net/builds/4chan-X.meta.js
// @downloadURL https://www.4chan-x.net/builds/4chan-X.user.js
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAF5JREFUeNrtkTESABAQxPD/R6tsE2dUGYUtFJvLDKf93KevHJAjpBorAQWSBIKqFASC4G0pCAkm4GfaEvgYXl0T6HBaE97f0vmnfYHbZOMLZCx9ISdKWwjOWZSC8GYm4SUGwfYgqI4AAAAASUVORK5CYII=
// ==/UserScript==

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

664
builds/4chan-XT-noupdate.user.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

60
builds/crx/eventPage.js Normal file
View File

@ -0,0 +1,60 @@
/*
* decaffeinate suggestions:
* DS101: Remove unnecessary use of Array.from
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/
let requestID = 0;
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
const id = requestID;
requestID++;
sendResponse(id);
return handlers[request.type](request, response => chrome.tabs.sendMessage(sender.tab.id, {id, data: response}));});
var handlers = {
permission(request, cb) {
const origins = request.origins || ['*://*/'];
return chrome.permissions.contains({origins}, function(result) {
if (result) {
return cb(result);
} else {
return chrome.permissions.request({origins}, function(result) {
if (chrome.runtime.lastError) {
return cb(false);
} else {
return cb(result);
}
});
}
});
},
ajax(request, cb) {
const xhr = new XMLHttpRequest();
xhr.open('GET', request.url, true);
xhr.responseType = request.responseType;
xhr.timeout = request.timeout;
const object = request.headers || {};
for (var key in object) {
var value = object[key];
xhr.setRequestHeader(key, value);
}
xhr.addEventListener('load', function() {
let {status, statusText, response} = this;
const responseHeaderString = this.getAllResponseHeaders();
if (response && (request.responseType === 'arraybuffer')) {
response = [...Array.from(new Uint8Array(response))];
}
return cb({status, statusText, response, responseHeaderString});
}
, false);
xhr.addEventListener('error', () => cb({error: true})
, false);
xhr.addEventListener('abort', () => cb({error: true})
, false);
xhr.addEventListener('timeout', () => cb({error: true})
, false);
return xhr.send();
}
};

BIN
builds/crx/icon128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

BIN
builds/crx/icon16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

BIN
builds/crx/icon48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

109
builds/crx/manifest.json Normal file
View File

@ -0,0 +1,109 @@
{
"name": "4chan XT",
"version": "XT 2.0.0",
"manifest_version": 2,
"description": "4chan XT is a script that adds various features to anonymous imageboards.",
"icons": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
},
"content_scripts": [
{
"js": [
"script.js"
],
"matches": [
"*://*.4chan.org/*",
"*://*.4channel.org/*",
"*://*.4cdn.org/*",
"https://erischan.org/*",
"https://www.erischan.org/*",
"https://fufufu.moe/*",
"https://gnfos.com/*",
"https://himasugi.blog/*",
"https://www.himasugi.blog/*",
"https://kakashinenpo.com/*",
"https://www.kakashinenpo.com/*",
"https://kissu.moe/*",
"https://www.kissu.moe/*",
"https://lainchan.org/*",
"https://www.lainchan.org/*",
"https://merorin.com/*",
"https://ota-ch.com/*",
"https://www.ota-ch.com/*",
"https://ponyville.us/*",
"https://www.ponyville.us/*",
"https://smuglo.li/*",
"https://notso.smuglo.li/*",
"https://smugloli.net/*",
"https://smug.nepu.moe/*",
"https://sportschan.org/*",
"https://www.sportschan.org/*",
"https://sushigirl.us/*",
"https://www.sushigirl.us/*",
"https://tvch.moe/*"
],
"exclude_matches": [
"*://www.4chan.org/advertise",
"*://www.4chan.org/advertise?*",
"*://www.4chan.org/donate",
"*://www.4chan.org/donate?*",
"*://www.4channel.org/advertise",
"*://www.4channel.org/advertise?*",
"*://www.4channel.org/donate",
"*://www.4channel.org/donate?*"
],
"all_frames": true,
"run_at": "document_start"
}
],
"background": {
"scripts": [
"eventPage.js"
],
"persistent": false
},
"homepage_url": "https://github.com/TuxedoTako/4chan-xt",
"minimum_chrome_version": "80",
"permissions": [
"*://*.4chan.org/*",
"*://*.4channel.org/*",
"*://*.4cdn.org/*",
"https://erischan.org/*",
"https://www.erischan.org/*",
"https://fufufu.moe/*",
"https://gnfos.com/*",
"https://himasugi.blog/*",
"https://www.himasugi.blog/*",
"https://kakashinenpo.com/*",
"https://www.kakashinenpo.com/*",
"https://kissu.moe/*",
"https://www.kissu.moe/*",
"https://lainchan.org/*",
"https://www.lainchan.org/*",
"https://merorin.com/*",
"https://ota-ch.com/*",
"https://www.ota-ch.com/*",
"https://ponyville.us/*",
"https://www.ponyville.us/*",
"https://smuglo.li/*",
"https://notso.smuglo.li/*",
"https://smugloli.net/*",
"https://smug.nepu.moe/*",
"https://sportschan.org/*",
"https://www.sportschan.org/*",
"https://sushigirl.us/*",
"https://www.sushigirl.us/*",
"https://tvch.moe/*",
"storage"
],
"optional_permissions": [
"*://*/"
],
"applications": {
"gecko": {
"id": "4chan-x@4chan-x.net"
}
}
}

27186
builds/crx/script.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,12 +0,0 @@
{
"addons": {
"4chan-x@4chan-x.net": {
"updates": [
{
"version": "1.14.22.4",
"update_link": "https://www.4chan-x.net/builds/4chan-X-beta.crx"
}
]
}
}
}

View File

@ -1,7 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X-beta.crx' version='1.14.22.4' />
</app>
</gupdate>

View File

@ -1,12 +0,0 @@
{
"addons": {
"4chan-x@4chan-x.net": {
"updates": [
{
"version": "1.14.22.4",
"update_link": "https://www.4chan-x.net/builds/4chan-X.crx"
}
]
}
}
}

View File

@ -1,7 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X.crx' version='1.14.22.4' />
</app>
</gupdate>

View File

@ -8,9 +8,9 @@
"page": "https://github.com/TuxedoTako/4chan-xt",
"downloads": "https://github.com/TuxedoTako/4chan-xt/releases",
"oldVersions": "https://raw.githubusercontent.com/ccd0/4chan-x/",
"faq": "https://github.com/TuxedoTako/4chan-xt/wiki/Frequently-Asked-Questions",
"captchaFAQ": "https://github.com/TuxedoTako/4chan-xt/wiki/Captcha-FAQ",
"cssGuide": "https://github.com/TuxedoTako/4chan-xt/wiki/Styling-Guide",
"faq": "https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions",
"captchaFAQ": "https://github.com/ccd0/4chan-x/wiki/Captcha-FAQ",
"cssGuide": "https://github.com/ccd0/4chan-x/wiki/Styling-Guide",
"license": "https://github.com/TuxedoTako/4chan-xt/blob/master/LICENSE",
"changelog": "https://github.com/TuxedoTako/4chan-xt/blob/master/CHANGELOG.md",
"issues": "https://github.com/TuxedoTako/4chan-xt/issues",
@ -121,7 +121,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/ccd0/4chan-x.git"
"url": "https://github.com/TuxedoTako/4chan-xt.git"
},
"contributors": [
"James Campos <james.r.campos@gmail.com>",

View File

@ -80,9 +80,7 @@ export default async function generateMetadata(packageJson, channel) {
output += '\n// @run-at document-start';
if (channel === '-noupdate') {
output += '\n// @updateURL https://noupdate.invalid/\n// @downloadURL https://noupdate.invalid/';
} else {
if (channel !== '-noupdate') {
output += `
// @updateURL ${meta.downloads}${packageJson.name}${channel}.meta.js
// @downloadURL ${meta.downloads}${packageJson.name}${channel}.user.js`;

View File

@ -11,7 +11,7 @@ import terser from '@rollup/plugin-terser';
const __dirname = dirname(fileURLToPath(import.meta.url));
const buildDir = resolve(__dirname, '../builds/test/');
const buildDir = resolve(__dirname, '../builds/');
let channel = '';

View File

@ -1,4 +1,4 @@
{
"version": "1.14.22.4",
"date": "2023-02-28T22:19:57.872Z"
"version": "XT 2.0.0",
"date": "2023-04-30T13:46:25Z"
}