Comments (5)
This appears to be fixable by modifying this piece of the userscript.
I don't know how to apply this to the actual project, and have just manually modified the userscript to test.
I don't know much about coffeescript, and the code in ImageCommon.coffee
is not aligning with my installed userscript when I try to compile it, even before changes.
ImageCommon = {
//Other functions
download: function(e) {
var download, href, ref;
if (this.protocol === 'blob:') {
return true;
}
e.preventDefault();
ref = this, href = ref.href+'?foo', download = ref.download;
return CrossOrigin.file(href, function(blob) {
var a;
if (blob) {
a = $.el('a', {
href: URL.createObjectURL(blob),
download: download,
hidden: true
});
$.add(d.body, a);
a.click();
return $.rm(a);
} else {
return new Notice('warning', "Could not download " + href, 20);
}
});
}
}
Specifically this line:
ref = this, href = ref.href, download = ref.download;
to:
ref = this, href = ref.href+'?foo', download = ref.download;
Adding ?ANYTHING after the image href when downloading will download the original size.
from 4chan-x.
@ClawhammerLobotomy Wow thank you very much! Looking at the discussion in your pull request, I tried to make a 'random' version of your userscript-version provided here. However writing something like this:
testnegneg = '?' + Math.random().toString(36).slice(2)
ref = this, href = ref.href + testnegneg, download = ref.download;
breaks the download button's functionality. Do you have any solution to this?
Thanks for your great insight.
from 4chan-x.
@yomukana
Did you check out my pull request?
It should already be updated with the randomized version, and it is working for me with the download button.
Your issue seems to be that you haven't declared testnegneg
prior to using it, unless you didn't add it in your example.
The variables are defined at the start of the function for this. I added "search" here.
download: function(e) {
var download, href, ref, search;
if (this.protocol === 'blob:') {
return true;
}
e.preventDefault();
ref = this, href = ref.href, download = ref.download;
search = Date.now() + Math.random().toString(20).substring(2);
href = href + '?' + search;
from 4chan-x.
@ClawhammerLobotomy Thanks! Yes I did read your pull request but it used the & operator which seemed unnecessary to me so I wanted to make my own version, but now everything is solved. Should I close the issue or wait until your new pull is merged?
from 4chan-x.
It should probably remain open in case someone else searches for the issue.
Not sure how often pull requests are reviewed.
This info could at least serve as a workaround for someone who cares enough about the compression to implement themselves.
from 4chan-x.
Related Issues (20)
- 4chan says post successful but no post is actually made?
- Captcha missing
- Disable ctrl+shift click to hide thread from catalog in settings?
- Blue boards not getting the .current css class applied
- [Feature Request] On user specified threads: Play a sound when thread limit is nearly reached (~300 posts)
- [Feature Request] When using Quote Inlining, Shift + Left Click should bypass inlining & jump to post
- Auto Update Connection Error HOT 3
- [Feature Request] Set active thread with a click ( for keyboard navigation )
- 4channel is dead HOT 1
- Could you filter an unique string from a particular flag? HOT 2
- 4chan X v1.14.22 - cloudflare error
- How do I filter within the first line of a comment? HOT 8
- Can't post, am I retarded? (yes) HOT 1
- can't paste images into the Quick reply and selecting text and clicking on the backlink does nothing instead of quoting that text in my reply
- 4chan removed IP counter from threads. I think they removed the API as well. HOT 4
- [Feature Request] Add an option to filter mass-reply posts. HOT 2
- [Feature Request] Contract by dragging to the right (firefox)
- [Feature Request] Resize webms/pictures/gifs exceeding user's window/certain resolution to fit constant size HOT 5
- Filtering only comments that don't have files in them HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 4chan-x.