Compare commits
8 Commits
799e4c4ab7
...
4d94d2d2e6
Author | SHA1 | Date | |
---|---|---|---|
4d94d2d2e6 | |||
32a23e9a17 | |||
fb340ed3fa | |||
568c039895 | |||
f75442ac2b | |||
58b522be65 | |||
2ce2830351 | |||
aaeb755c64 |
9
config.h
9
config.h
|
@ -2,10 +2,13 @@
|
|||
#include <stdbool.h>
|
||||
|
||||
/* See more:
|
||||
* https://webkitgtk.org/reference/webkit2gtk/stable/class.Settings.html */
|
||||
#define WEBKIT \
|
||||
* https://webkitgtk.org/reference/webkit2gtk/stable/class.Settings.html
|
||||
*
|
||||
*/
|
||||
#define WEBKIT_DEFAULT_SETTINGS \
|
||||
"enable-back-forward-navigation-gestures", true, "enable-developer-extras", true, \
|
||||
"enable-smooth-scrolling", false
|
||||
"enable-smooth-scrolling", false, \
|
||||
"default-charset", "utf-8"
|
||||
|
||||
#define GTK "gtk-application-prefer-dark-theme", false, "gtk-enable-animations", false
|
||||
#define ROSE_HOMEPAGE false
|
||||
|
|
3
makefile
3
makefile
|
@ -96,5 +96,4 @@ clean:
|
|||
rm $(CACHE_DIR)
|
||||
|
||||
format: $(SRC) $(PLUGS)
|
||||
$(FORMATTER) $(SRC) $(PLUGS)
|
||||
|
||||
$(FORMATTER) $(SRC) $(PLUGS) $(rose.h)
|
||||
|
|
|
@ -48,7 +48,7 @@ int libre_redirect(const char* uri, char* output)
|
|||
"https://search.nunosempere.com",
|
||||
"https://scribe.rip",
|
||||
"https://translate.riverside.rocks/",
|
||||
"https://archive.is/https://www.bloomberg.com",
|
||||
"https://archive.today/https://www.bloomberg.com",
|
||||
"https://royalread.nunosempere.com",
|
||||
"https://dumb.vern.cc",
|
||||
// "https://wayback.nunosempere.com",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define READABILITY_N 85314 + 1000
|
||||
#define READABILITY_N 88023 + 1000
|
||||
|
||||
void read_readability_js(char* string)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef READABILITY
|
||||
#define READABILITY
|
||||
|
||||
#define READABILITY_N 85314 + 1000
|
||||
#define READABILITY_N 88023 + 1000
|
||||
|
||||
void read_readability_js(char* string);
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +1,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define STYLE_N 4748 + 100
|
||||
#define STYLE_N 4709 + 100
|
||||
|
||||
void read_style_js(char* string)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef STYLE
|
||||
#define STYLE
|
||||
|
||||
#define STYLE_N 4748 + 100
|
||||
#define STYLE_N 4709 + 100
|
||||
|
||||
void read_style_js(char* string);
|
||||
|
||||
|
|
|
@ -18,11 +18,11 @@ if (document.domain == "forum.effectivealtruism.org"){
|
|||
.intercom-lightweight-app{
|
||||
display: none;
|
||||
}
|
||||
`
|
||||
var styleSheet = document.createElement('style')
|
||||
styleSheet.innerText = styles
|
||||
document.head.appendChild(styleSheet)
|
||||
console.log('Style changed')
|
||||
`;
|
||||
var styleSheet = document.createElement("style");
|
||||
styleSheet.innerText = styles;
|
||||
document.head.appendChild(styleSheet);
|
||||
console.log("Style changed");
|
||||
}
|
||||
|
||||
if (document.domain == "mail.proton.me") {
|
||||
|
@ -39,14 +39,14 @@ if (document.domain == "mail.proton.me" ){
|
|||
}
|
||||
zoom: 0.625 !important;
|
||||
*/
|
||||
`
|
||||
`;
|
||||
}
|
||||
if (document.domain == "forum.nunosempere.com") {
|
||||
styles = `
|
||||
body {
|
||||
zoom: 0.625 !important;
|
||||
}
|
||||
`
|
||||
`;
|
||||
}
|
||||
if (document.domain == "search.nunosempere.com") {
|
||||
styles = `
|
||||
|
@ -57,7 +57,7 @@ if (document.domain == "search.nunosempere.com" ){
|
|||
footer {
|
||||
display: none;
|
||||
}
|
||||
`
|
||||
`;
|
||||
}
|
||||
if (document.domain == "twitter.com") {
|
||||
styles = `
|
||||
|
@ -78,7 +78,7 @@ if (document.domain == "twitter.com" ){
|
|||
[data-testid^="sidebarColumn"] {
|
||||
display: none;
|
||||
}
|
||||
`
|
||||
`;
|
||||
}
|
||||
|
||||
if (document.domain == "reddit.com" || document.domain == "old.reddit.com") {
|
||||
|
@ -97,21 +97,20 @@ if (document.domain == "reddit.com" || document.domain == "old.reddit.com"){
|
|||
{
|
||||
display: none !important;
|
||||
}
|
||||
`
|
||||
`;
|
||||
}
|
||||
|
||||
if (styles != null) {
|
||||
var styleSheet = document.createElement('style')
|
||||
styleSheet.innerText = styles
|
||||
document.head.appendChild(styleSheet)
|
||||
console.log('Style changed')
|
||||
var styleSheet = document.createElement("style");
|
||||
styleSheet.innerText = styles;
|
||||
document.head.appendChild(styleSheet);
|
||||
console.log("Style changed");
|
||||
}
|
||||
|
||||
|
||||
// Replace default alert with new function
|
||||
// whose style can be changed!
|
||||
window.alert = (message) => {
|
||||
let alertDiv = document.getElementById('customAlert');
|
||||
let alertDiv = document.getElementById("customAlert");
|
||||
if (!alertDiv) {
|
||||
const html = `
|
||||
<div id="customAlert" class="custom-alert">
|
||||
|
@ -145,26 +144,29 @@ window.alert = (message) => {
|
|||
}
|
||||
</style>
|
||||
`;
|
||||
document.body.insertAdjacentHTML('beforeend', html);
|
||||
alertDiv = document.getElementById('customAlert');
|
||||
document.getElementById('alertOkButton').onclick = () => {
|
||||
alertDiv.classList.remove('visible');
|
||||
document.removeEventListener('keydown', dismissAlert);
|
||||
document.body.insertAdjacentHTML("beforeend", html);
|
||||
alertDiv = document.getElementById("customAlert");
|
||||
document.getElementById("alertOkButton").onclick = () => {
|
||||
alertDiv.classList.remove("visible");
|
||||
document.removeEventListener("keydown", dismissAlert);
|
||||
};
|
||||
}
|
||||
|
||||
const dismissAlert = (event) => {
|
||||
if (event.key === 'Enter' /*&& event.ctrlKey*/ && alertDiv.classList.contains('visible')) {
|
||||
alertDiv.classList.remove('visible');
|
||||
document.removeEventListener('keydown', dismissAlert);
|
||||
}
|
||||
if (
|
||||
event.key === "Enter" /*&& event.ctrlKey*/ &&
|
||||
alertDiv.classList.contains("visible")
|
||||
) {
|
||||
alertDiv.classList.remove("visible");
|
||||
document.removeEventListener("keydown", dismissAlert);
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener('keydown', dismissAlert);
|
||||
document.getElementById('alertMessage').textContent = message;
|
||||
alertDiv.classList.add('visible');
|
||||
}
|
||||
document.addEventListener("keydown", dismissAlert);
|
||||
document.getElementById("alertMessage").textContent = message;
|
||||
alertDiv.classList.add("visible");
|
||||
};
|
||||
// ^ takes 0.014ms to run, so performance is not the concern here.
|
||||
// timed with console.time, console.timeEnd
|
||||
|
||||
document.body.style.visibility = "visible"
|
||||
document.body.style.visibility = "visible";
|
||||
|
|
2
rose.c
2
rose.c
|
@ -55,7 +55,7 @@ WebKitWebView* webview_new()
|
|||
WebKitCookieManager* cookiemanager;
|
||||
WebKitUserContentManager* contentmanager;
|
||||
|
||||
settings = webkit_settings_new_with_settings(WEBKIT, NULL);
|
||||
settings = webkit_settings_new_with_settings(WEBKIT_DEFAULT_SETTINGS, NULL);
|
||||
if (CUSTOM_USER_AGENT) {
|
||||
webkit_settings_set_user_agent(
|
||||
settings,
|
||||
|
|
Loading…
Reference in New Issue
Block a user