Delete per-phase dirs from /devtools-extension/#106
Conversation
| </div> | ||
|
|
||
| <h3>Send message from DevTools to inspected page</h3> | ||
| <input type="button" id="sayHello" value="Say hello to the inspected page"><!-- todo: alert is sometimes displayed twice (in "main" as well) --> |
There was a problem hiding this comment.
The alert is sometimes displayed twice, in this extension and in "main" branch.
No consistent repro steps yet; d/k why alert is displayed twice sometimes.
There was a problem hiding this comment.
I tested locally with the main branch (step 4), but I never saw the alert twice in a row.
If you can't get consistent repro steps, I advise resolving this comment and removing the hidden TODO for now. When/if you find consistent repro steps, please open a new issue on the Demos repo to investigate.
| <input type="button" id="sayHello" value="Say hello to the inspected page"><!-- todo: alert is sometimes displayed twice (in "main" as well) --> | |
| <input type="button" id="sayHello" value="Say hello to the inspected page"> |
| // Send a message back to DevTools | ||
| connections[id].postMessage("Connected!"); | ||
| // Send a message back to DevTools. | ||
| connections[id].postMessage("Connected!"); // todo: where can we see the message "Connected!" in DevTools? |
There was a problem hiding this comment.
How/where can we see the "Connected!" message?
There was a problem hiding this comment.
I spent quite a lot of time investigating this without finding the answer. This message is weirdly not getting received by any listener.
I think it's either not getting sent correctly, or not getting listened to correctly.
Either way, the entire service-worker.js file is not needed by this extension. To test, I removed:
"background": {
"service_worker": "service-worker.js"
},from the manifest.json file, and all of the features of the extension (memory, click coordinates, and alert) continued to work as before.
The service worker is not playing any role in sending messages back and forth between processes in this extension.
Therefore, I think we should delete the lines above from manifest.json, and delete the entire service-worker.js file.
And then, simplify the https://review.learn.microsoft.com/en-us/microsoft-edge/extensions/developer-guide/devtools-extension?branch=pr-en-us-3616 article to reflect this.
| </div> | ||
|
|
||
| <h3>Send message from DevTools to inspected page</h3> | ||
| <input type="button" id="sayHello" value="Say hello to the inspected page"><!-- todo: alert is sometimes displayed twice (in "main" as well) --> |
There was a problem hiding this comment.
I tested locally with the main branch (step 4), but I never saw the alert twice in a row.
If you can't get consistent repro steps, I advise resolving this comment and removing the hidden TODO for now. When/if you find consistent repro steps, please open a new issue on the Demos repo to investigate.
| <input type="button" id="sayHello" value="Say hello to the inspected page"><!-- todo: alert is sometimes displayed twice (in "main" as well) --> | |
| <input type="button" id="sayHello" value="Say hello to the inspected page"> |
| // Send a message back to DevTools | ||
| connections[id].postMessage("Connected!"); | ||
| // Send a message back to DevTools. | ||
| connections[id].postMessage("Connected!"); // todo: where can we see the message "Connected!" in DevTools? |
There was a problem hiding this comment.
I spent quite a lot of time investigating this without finding the answer. This message is weirdly not getting received by any listener.
I think it's either not getting sent correctly, or not getting listened to correctly.
Either way, the entire service-worker.js file is not needed by this extension. To test, I removed:
"background": {
"service_worker": "service-worker.js"
},from the manifest.json file, and all of the features of the extension (memory, click coordinates, and alert) continued to work as before.
The service worker is not playing any role in sending messages back and forth between processes in this extension.
Therefore, I think we should delete the lines above from manifest.json, and delete the entire service-worker.js file.
And then, simplify the https://review.learn.microsoft.com/en-us/microsoft-edge/extensions/developer-guide/devtools-extension?branch=pr-en-us-3616 article to reflect this.
This PR is ready to merge, but don't merge this PR until merge PR 3616.
Related PRs:
Branch dir:
Changes:
AB#59925391