mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-17 23:08:33 +02:00
Improve content script injection (#240)
* Improve content script injection * Add an error handler for content script injection * Use a guard variable in the content script, instead * Fix comment * Ensure tabID is unchanged; fix image styles * Only inject script once; use CSS to hide page * Display an error when the script can't be executed; document other limitations * Log error on script execute failure
This commit is contained in:
@@ -2,6 +2,10 @@ html, body {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.button {
|
||||
margin: 3% auto;
|
||||
padding: 4px;
|
||||
@@ -18,10 +22,10 @@ html, body {
|
||||
background-color: #E5F2F2;
|
||||
}
|
||||
|
||||
.clear {
|
||||
.reset {
|
||||
background-color: #FBFBC9;
|
||||
}
|
||||
|
||||
.clear:hover {
|
||||
.reset:hover {
|
||||
background-color: #EAEA9D;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user