-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make proxy related permissions optional
- Loading branch information
Showing
10 changed files
with
132 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { ref } from 'vue'; | ||
import { getProxyPermissions, requestProxyPermissions } from '@/helpers/permissions'; | ||
|
||
const useProxyPermissions = () => { | ||
const proxyPermissionsGranted = ref(false); | ||
|
||
const checkProxyPermissions = async () => { | ||
proxyPermissionsGranted.value = await getProxyPermissions(); | ||
}; | ||
|
||
const triggerProxyPermissions = async () => { | ||
proxyPermissionsGranted.value = await requestProxyPermissions(); | ||
}; | ||
|
||
checkProxyPermissions(); | ||
|
||
return { proxyPermissionsGranted, triggerProxyPermissions }; | ||
}; | ||
|
||
export default useProxyPermissions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export const getProxyPermissions = async () => { | ||
return await browser.permissions.contains({ | ||
permissions: ['proxy', 'tabs'], | ||
origins: ['<all_urls>'], | ||
}); | ||
}; | ||
|
||
export const requestProxyPermissions = async () => { | ||
return await browser.permissions.request({ | ||
permissions: ['proxy', 'tabs'], | ||
origins: ['<all_urls>'], | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters