Skip to content

Commit

Permalink
デフォルト値指定
Browse files Browse the repository at this point in the history
  • Loading branch information
kaonasi-biwa committed Dec 19, 2023
1 parent d0a454a commit 8712f9e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion browser/components/newtab/lib/PrefsFeed.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class PrefsFeed {

}
}else if(Services.prefs.getIntPref("browser.newtabpage.activity-stream.floorp.background.type") == 4){
const tmpPath = Services.prefs.getStringPref("browser.newtabpage.activity-stream.floorp.background.image.path")
const tmpPath = Services.prefs.getStringPref("browser.newtabpage.activity-stream.floorp.background.image.path") || PathUtils.join(Services.dirsvc.get("ProfD", Ci.nsIFile).path, "newtabImages","wallpaper.png")
const fetchPath = Services.io.newFileURI(FileUtils.File(tmpPath)).asciiSpec
if(tmpPath != this.oneImageData.url){
this.oneImageData = {"url":tmpPath,data:"","extension":"",notExist:false}
Expand Down
3 changes: 2 additions & 1 deletion browser/components/preferences/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,8 @@ var gHomePane = {
},

imagePathInputSet(){
let folderPath = Services.prefs.getStringPref("browser.newtabpage.activity-stream.floorp.background.image.path","")
let folderPath = Services.prefs.getStringPref("browser.newtabpage.activity-stream.floorp.background.image.path") || PathUtils.join(Services.dirsvc.get("ProfD", Ci.nsIFile).path, "newtabImages","wallpaper.png")
console.log(folderPath)
document.querySelector("#picturePath").value = folderPath
document.querySelector("#picturePath").style.backgroundImage = `url(moz-icon://${Services.io.newFileURI(FileUtils.File(folderPath)).asciiSpec})`
}
Expand Down

0 comments on commit 8712f9e

Please sign in to comment.