Skip to content

Instantly share code, notes, and snippets.

@cutls
Last active November 16, 2019 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cutls/1400f06a535c5fd697acca62ec2b2642 to your computer and use it in GitHub Desktop.
Save cutls/1400f06a535c5fd697acca62ec2b2642 to your computer and use it in GitHub Desktop.
Pleromaを普通の日本語にするブックマークレット

Pleromaを普通の日本語にするブックマークレット

ブラウザのローカルデータベース(indexedDB)に保存するため一度やったらそれなりに持続性があるはず

ブックマークレットの導入

https://toot.app/export/

これみて、「コードをコピー」せずに下のbookmarklet.jsを代わりにコピーすればよろし

javascript: (function(){const dbName="localforage",storeName="keyvaluepairs",openReq=indexedDB.open(dbName);openReq.onsuccess=function(e){let o=e.target.result;console.log(o);let n=o.transaction(storeName,"readwrite").objectStore(storeName);console.log(n);let t=n.openCursor(IDBKeyRange.only("vuex-lz"));t.onsuccess=function(e){let o=t.result;if(o){o.value.config.interfaceLanguage="ja_pedantic",o.update(o.value).onsuccess=function(){location.reload()},o.continue()}},o.close()},openReq.onerror=function(e){console.error("db open error")};}());
const dbName = 'localforage'
const storeName = 'keyvaluepairs'
const openReq = indexedDB.open(dbName)
openReq.onsuccess = function(event) {
let db = event.target.result
console.log(db)
let trans = db.transaction(storeName, 'readwrite')
let store = trans.objectStore(storeName)
console.log(store)
let request = store.openCursor(IDBKeyRange.only('vuex-lz'))
request.onsuccess = function(event) {
let cursor = request.result
if (cursor) {
cursor.value.config.interfaceLanguage = "ja_pedantic"
let updateRequest = cursor.update(cursor.value)
updateRequest.onsuccess = function() {
location.reload()
}
cursor.continue()
}
}
db.close()
}
openReq.onerror = function(event) {
console.error('db open error')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment