X
點擊此處開啟此網站的行動版。

技術支援討論區

How can I determine programatically if firefox is running with my extension installed. I need to do this from an OSX cocoa application.

已張貼

I need to determine programatically if firefox started with a profile that has my extension installed. I need to do this from an OSX Cocoa application. Is there a way to determine the current profile being used by firefox? Or is there a way to determine if a particular extension is installed for the current profile?

I need to determine programatically if firefox started with a profile that has my extension installed. I need to do this from an OSX Cocoa application. Is there a way to determine the current profile being used by firefox? Or is there a way to determine if a particular extension is installed for the current profile?

被選擇的解決方法

jscher2000 said

The parent.lock file in a running profile folder will be locked, while in other profile folders it can be opened (blank file). Not sure what over method you could use.


Thanks for your response. I checked the .parentlock file in the profile being used by firefox. It is not locked. I tried to manually check (using getinfo on the file on mac) and also programatically using NSFileManager attributesOfItemAtPath (looking for the NSFileImmutable key). Both indicate the file is not locked. Am i missing something?

I did find that the FileModificationDate on the .parentlock file of the current profile being used will be the latest when compared to other profiles. I am using this to determine the current profile that firefox is using. Thank you !

從原來的回覆中察看解決方案 0
引用
cor-el
  • Top 10 Contributor
  • Moderator
17415 個解決方法 157321 個答案

Maybe install the extension globally to ensure that the extension is installed.

You can parse extensions.json in the profile folder to see what extensions are installed.

You can use the button on the "Help -> Troubleshooting Information" (about:support) page to go to the current Firefox profile folder or use the about:profiles page.

Maybe install the extension globally to ensure that the extension is installed. *https://support.mozilla.org/en-US/kb/customizing-firefox-using-policiesjson *https://github.com/mozilla/policy-templates/blob/master/README.md You can parse extensions.json in the profile folder to see what extensions are installed. You can use the button on the "Help -> Troubleshooting Information" (about:support) page to go to the current Firefox profile folder or use the <b>about:profiles</b> page. *Help -> Troubleshooting Information -> Profile Directory:<br>Windows: Show Folder; Linux: Open Directory; Mac: Show in Finder *https://support.mozilla.org/en-US/kb/Profiles
這篇文章有幫助嗎?
引用

提出問題者

Thanks for the reply. I need to know what profile is being used so I can parse the extensions.json file. I can do this manually by browsing to the about:profiles page. But, I need to programatically determine the current profile being used by firefox. How can I do this?

Thanks for the reply. I need to know what profile is being used so I can parse the extensions.json file. I can do this manually by browsing to the about:profiles page. But, I need to programatically determine the current profile being used by firefox. How can I do this?

由 sp.anon.me 於 修改

這篇文章有幫助嗎?
引用
jscher2000
  • Top 10 Contributor
8635 個解決方法 70637 個答案

有幫助的回覆

The parent.lock file in a running profile folder will be locked, while in other profile folders it can be opened (blank file). Not sure what over method you could use.

The parent.lock file in a running profile folder will be locked, while in other profile folders it can be opened (blank file). Not sure what over method you could use.
這篇文章有幫助嗎? 1
引用
cor-el
  • Top 10 Contributor
  • Moderator
17415 個解決方法 157321 個答案

有幫助的回覆

Note that each platform uses its own methods and files to lock a profile.

Note that each platform uses its own methods and files to lock a profile. *https://dxr.mozilla.org/mozilla-release/source/toolkit/profile/nsProfileLock.cpp
這篇文章有幫助嗎? 1
引用

提出問題者

Thanks for your response. I checked the .parentlock file in the profile being used by firefox. It is not locked. I tried to manually check (using getinfo on the file on mac) and also programatically using NSFileManager attributesOfItemAtPath (looking for the NSFileImmutable key). Both indicate the file is not locked. Am i missing something?

Thanks for your response. I checked the .parentlock file in the profile being used by firefox. It is not locked. I tried to manually check (using getinfo on the file on mac) and also programatically using NSFileManager attributesOfItemAtPath (looking for the NSFileImmutable key). Both indicate the file is not locked. Am i missing something?
這篇文章有幫助嗎?
引用

選擇的解決方法

jscher2000 said

The parent.lock file in a running profile folder will be locked, while in other profile folders it can be opened (blank file). Not sure what over method you could use.


Thanks for your response. I checked the .parentlock file in the profile being used by firefox. It is not locked. I tried to manually check (using getinfo on the file on mac) and also programatically using NSFileManager attributesOfItemAtPath (looking for the NSFileImmutable key). Both indicate the file is not locked. Am i missing something?

I did find that the FileModificationDate on the .parentlock file of the current profile being used will be the latest when compared to other profiles. I am using this to determine the current profile that firefox is using. Thank you !

''jscher2000 [[#answer-1244777|said]]'' <blockquote> The parent.lock file in a running profile folder will be locked, while in other profile folders it can be opened (blank file). Not sure what over method you could use. </blockquote> <blockquote> Thanks for your response. I checked the .parentlock file in the profile being used by firefox. It is not locked. I tried to manually check (using getinfo on the file on mac) and also programatically using NSFileManager attributesOfItemAtPath (looking for the NSFileImmutable key). Both indicate the file is not locked. Am i missing something? </blockquote> I did find that the FileModificationDate on the .parentlock file of the current profile being used will be the latest when compared to other profiles. I am using this to determine the current profile that firefox is using. Thank you !

由 sp.anon.me 於 修改

這篇文章有幫助嗎?
引用
問個問題

如果您還沒有帳號,您必須先 登入您的帳號 來回覆文章。請 開始一個新問題