Firefox and Safari let the users enable the extension on every website if optional_host_permissions
or optional_permissions
include <all_urls>
or *://*/*
. More details.
Generally this is not the intention of the extension developer and it can lead to unexpected behavior. The user should just enable the extension on each website individually, for example using webext-permission-toggle.
This helper will immediately undo the user's action when they enable the extension on all websites. This also works retroactively if it detects the "all urls" permission on update.
// In background.js
import 'webext-bugs/no-all-urls';
Alternatively, you can customize the message:
// In background.js
import {customizeNoAllUrlsErrorMessage} from 'webext-bugs/no-all-urls';
customizeNoAllUrlsErrorMessage('Refined GitHub is not meant to run on every website. Open the options for more info.');
- Firefox
- Safari
- Chrome (even if it doesn't have such button/toggle)
<all_urls>
or*://*/*
as optional permissions
- Background
![](https://private-user-images.githubusercontent.com/1402241/405835545-62c79d16-09b1-4cd4-a689-2a05b2a70d35.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTU5NDQsIm5iZiI6MTczOTI5NTY0NCwicGF0aCI6Ii8xNDAyMjQxLzQwNTgzNTU0NS02MmM3OWQxNi0wOWIxLTRjZDQtYTY4OS0yYTA1YjJhNzBkMzUuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMTc0MDQ0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NWQzZWIyMmQzMjk3ZjMzZWU3YTM3YWIyOWE2NWM0MTAxODEyYmZmODUwM2JiYmE5NDNlYWE5MmYyMzE3YjE5YyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.tGorSqlshiTiwEJXmXZF5Rui2mVDnWr2FOL5_rb0dGg)