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
11 changes: 11 additions & 0 deletions home/src/main/ets/blocks/meowUAManager.ets
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import { bunch_of_settings } from '../hosts/bunch_of_settings';
import { bunch_of_user_agents, user_agent } from '../hosts/bunch_of_user_agents';
import { kv_store_put } from '../utils/kv_store_tools';
import { default_user_agents } from '../hosts/bunch_of_defaults';

@Component
struct meowUAManager {
Expand Down Expand Up @@ -83,6 +84,10 @@ struct meowUAManager {
)

Row() {
linysSymbol({ symbol_glyph_target: 'sys.symbol.clean' })
.onClick(() => {
this.clean_and_reset_ua();
})
Blank()
linysSymbol({ symbol_glyph_target: 'sys.symbol.plus_square' })
.onClick(() => {
Expand Down Expand Up @@ -132,6 +137,12 @@ struct meowUAManager {
this.save_user_agents_to_kv_store();
}

clean_and_reset_ua() {
this.bunch_of_user_agents.import_string(default_user_agents());
this.sync_list_of_user_agents();
this.save_user_agents_to_kv_store();
}

// Data utils

sync_list_of_user_agents() {
Expand Down
1 change: 1 addition & 0 deletions home/src/main/ets/hosts/bunch_of_defaults.ets
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export function default_user_agents() {
"Firefox Windows 132\nMozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0",
"Chrome Windows 130\nMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36",
"Edge Windows 130\nMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0",
"Android 12\nMozilla/5.0 (Linux; Android 12; ALN-AL80 Build/5.0.0.107) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Mobile Safari/537.36",
];
return result.join("\n");
}