Repository navigation
Support custom protocols - #65
Conversation
zepto always fails when requesting custom protocols, 💩.
|
The WebKit only allows setting referrer for urls with |
|
Forgive my ignorance here, but I don't understand why the referrer header is required. Is it required to resolve relative URLs or something? |
|
it's required to resolve file paths in URLs with custom protocols, when writing something like |
|
Yeah, that makes sense. We could use the custom protocol only to resolve absolute references on the load path, but I think it would probably be better to traverse the ancestor directories looking for |
|
I'm not sure I understand the requirements. Can you give some examples of URLs and the file paths they should map to? |
|
We're looking for a coherent mechanism for referring to images and other static resources provided by third-party packages. I'm imagining that |
|
This is how I think the API would be like: var protocol = require('protocol');
protocol.registerProtocol('atom', function(url, referrer) {
// The url is 'atom://avatar.png',
// and the referrer is 'file:///Applications/Atom.app/.../index.html',
// Then we calculate the actual path to requested resource by traversing ancestor directories:
// '/Applications/Atom.app/.../avatar.png',
return new protocol.RequestFileJob(calculatePathFromUrlAndReferrer(url, referrer));
});As for referrer, I just found that adding But another problem is, to resolve resource path like node's |
|
It seems really difficult (if not impossible?) to tie URL references in the DOM back to the class SomeView extends View
@content: -> @img src: @resolve('../images/flower.png')Could we add some kind of mechanism like |
|
@zcbenz After talking with Kevin the API you propose for registering a custom protocol from the JavaScript layer looks really good. Is it possible to provide a similar API to allow us to intercept relative |
|
Another thought: I wonder if it would improve performance to register callbacks that are associated with regular expressions? Then we can run the regular expression against the URL in the native layer and only call into JS if it matches a certain pattern. |
|
I found that the |
|
So the devtools' |
|
After some explores on implementing the
The 1 is simple, the 2 can be implemented but needs small patches on Chromium, the 3 seems impossible, and the 4 needs big patches on Chromium. Now I give up on this feature and stick to current API. |
Focus on devtools when it is opened on Mac.
Focus on devtools when it is opened on Mac.
|
Hi, guys! Do we plan to support |
Merged: [maglev] Account for phi smi type widening in BuildCheckHeapObject Bug: 495679730 (cherry picked from commit c1e78b455e3224e286914b5ac241fbea064cb51d) Change-Id: I77d6f184af8d62a0dbb643c6f34d4a3530b32b63 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7715042 Auto-Submit: Darius Mercadier <[email protected]> Reviewed-by: Leszek Swirski <[email protected]> Commit-Queue: Leszek Swirski <[email protected]> Cr-Commit-Position: refs/branch-heads/14.6@{#65}
Merged: [maglev] Account for phi smi type widening in BuildCheckHeapObject Bug: 495679730 (cherry picked from commit c1e78b455e3224e286914b5ac241fbea064cb51d) Change-Id: I77d6f184af8d62a0dbb643c6f34d4a3530b32b63 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7715042 Auto-Submit: Darius Mercadier <[email protected]> Reviewed-by: Leszek Swirski <[email protected]> Commit-Queue: Leszek Swirski <[email protected]> Cr-Commit-Position: refs/branch-heads/14.6@{#65} Cr-Branched-From: e04c3a1a2543bdbee7beac8846c9cbe8f657636f-refs/heads/14.6.202@{#1} Cr-Branched-From: 3b0b01e6594ec362369dc16f069012a81748c8ba-refs/heads/main@{#105132}
Merged: [maglev] Account for phi smi type widening in BuildCheckHeapObject Bug: 495679730 (cherry picked from commit c1e78b455e3224e286914b5ac241fbea064cb51d) Change-Id: I77d6f184af8d62a0dbb643c6f34d4a3530b32b63 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7715042 Auto-Submit: Darius Mercadier <[email protected]> Reviewed-by: Leszek Swirski <[email protected]> Commit-Queue: Leszek Swirski <[email protected]> Cr-Commit-Position: refs/branch-heads/14.6@{#65} Cr-Branched-From: e04c3a1a2543bdbee7beac8846c9cbe8f657636f-refs/heads/14.6.202@{#1} Cr-Branched-From: 3b0b01e6594ec362369dc16f069012a81748c8ba-refs/heads/main@{#105132}
* chore: cherry-pick a0570afad500 from v8 [maglev] Fix deopt use counting for deopt scope data We shouldn't count the deopt use when creating the scope data, but only when creating the deopt frame. If the scope was unused, then we were over counting, not really a correctness issue though. If the scope was used twice, we were under counting and we can underflow the counting when removing the use of a node. Fixed: 470566252 Change-Id: I7b6f5647d1ed1f9a7c915d3682f10cfc71a5924c Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7415271 Commit-Queue: Toon Verwaest <[email protected]> Reviewed-by: Toon Verwaest <[email protected]> Commit-Queue: Victor Gomes <[email protected]> Auto-Submit: Victor Gomes <[email protected]> Cr-Commit-Position: refs/heads/main@{#104601} * chore: cherry-pick b54c7841e2cd from v8 [*lev] Correctly update use counts for nested builtin continuations Fixed: 484527367 Change-Id: I4cda8c1bbb2788fca06b564eae509511aec0957e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7593054 Reviewed-by: Victor Gomes <[email protected]> Auto-Submit: Darius Mercadier <[email protected]> Commit-Queue: Darius Mercadier <[email protected]> Cr-Commit-Position: refs/heads/main@{#105381} * chore: cherry-pick ba0258ba9609 from v8 [inspector] Use std::shared_ptr for InspectedContext Unfortunately at this point we are not able to move `InspectedContext` to the managed C++ heap due to missing Heap* collections and the lack of labeling retainer links. The next best thing we can do for now is use std::shared_ptr for InspectedContext and keep an instance on the stack every time we can potentially transition into user JS. [email protected] Fixed: 486927780 Change-Id: I5e4921521a24cc3cd53ffb6cb5b6b6f9d98490e2 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7613210 Auto-Submit: Simon Zünd <[email protected]> Reviewed-by: Benedikt Meurer <[email protected]> Commit-Queue: Simon Zünd <[email protected]> Commit-Queue: Benedikt Meurer <[email protected]> Cr-Commit-Position: refs/heads/main@{#105489} * chore: cherry-pick 2d9ff4098967 from v8 Merged: [maglev] Avoid eliding Smi checks too aggressively (cherry picked from commit 433b2912c5cb94ed0979c8284e96e4d08416b620) Bug: 491884710 Change-Id: Id73c522c6f55cb05167f436c2ee7f60e0db71840 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7673820 Reviewed-by: Leszek Swirski <[email protected]> Commit-Queue: Leszek Swirski <[email protected]> Auto-Submit: Darius Mercadier <[email protected]> Cr-Commit-Position: refs/branch-heads/14.6@{#45} Cr-Branched-From: e04c3a1a2543bdbee7beac8846c9cbe8f657636f-refs/heads/14.6.202@{#1} Cr-Branched-From: 3b0b01e6594ec362369dc16f069012a81748c8ba-refs/heads/main@{#105132} * chore: cherry-pick f297f82fea96 from v8 Merged: [compiler][arm64] Force explicit zero-extension of load index This is the merge-commit for: 1) [arm64][compiler] Always emit truncation to word32 cherry picked from commit 522e74a35cf4e53c3708ea396c299bfbb29d8489 2) [compiler][arm64] Reenable implicit truncation and force explicit zero-extension of load/store index cherry picked from commit 4ef5cc27aa50b4a7e3096bbbffaf5058a811a2a9 Bug: 496301615 Change-Id: I3e5e13a90ad0a43768c9cd46a7ebd99d0f6a4e11 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7715044 Commit-Queue: Matthias Liedtke <[email protected]> Commit-Queue: Darius Mercadier <[email protected]> Reviewed-by: Darius Mercadier <[email protected]> Auto-Submit: Matthias Liedtke <[email protected]> Cr-Commit-Position: refs/branch-heads/14.6@{#63} Cr-Branched-From: e04c3a1a2543bdbee7beac8846c9cbe8f657636f-refs/heads/14.6.202@{#1} Cr-Branched-From: 3b0b01e6594ec362369dc16f069012a81748c8ba-refs/heads/main@{#105132} * chore: cherry-pick 021c5b193bd4 from v8 Merged: [maglev] Account for phi smi type widening in BuildCheckHeapObject Bug: 495679730 (cherry picked from commit c1e78b455e3224e286914b5ac241fbea064cb51d) Change-Id: I77d6f184af8d62a0dbb643c6f34d4a3530b32b63 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7715042 Auto-Submit: Darius Mercadier <[email protected]> Reviewed-by: Leszek Swirski <[email protected]> Commit-Queue: Leszek Swirski <[email protected]> Cr-Commit-Position: refs/branch-heads/14.6@{#65} Cr-Branched-From: e04c3a1a2543bdbee7beac8846c9cbe8f657636f-refs/heads/14.6.202@{#1} Cr-Branched-From: 3b0b01e6594ec362369dc16f069012a81748c8ba-refs/heads/main@{#105132}
* chore: cherry-pick a0570afad500 from v8 [maglev] Fix deopt use counting for deopt scope data We shouldn't count the deopt use when creating the scope data, but only when creating the deopt frame. If the scope was unused, then we were over counting, not really a correctness issue though. If the scope was used twice, we were under counting and we can underflow the counting when removing the use of a node. Fixed: 470566252 Change-Id: I7b6f5647d1ed1f9a7c915d3682f10cfc71a5924c Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7415271 Commit-Queue: Toon Verwaest <[email protected]> Reviewed-by: Toon Verwaest <[email protected]> Commit-Queue: Victor Gomes <[email protected]> Auto-Submit: Victor Gomes <[email protected]> Cr-Commit-Position: refs/heads/main@{#104601} * chore: cherry-pick b54c7841e2cd from v8 [*lev] Correctly update use counts for nested builtin continuations Fixed: 484527367 Change-Id: I4cda8c1bbb2788fca06b564eae509511aec0957e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7593054 Reviewed-by: Victor Gomes <[email protected]> Auto-Submit: Darius Mercadier <[email protected]> Commit-Queue: Darius Mercadier <[email protected]> Cr-Commit-Position: refs/heads/main@{#105381} * chore: cherry-pick ba0258ba9609 from v8 [inspector] Use std::shared_ptr for InspectedContext Unfortunately at this point we are not able to move `InspectedContext` to the managed C++ heap due to missing Heap* collections and the lack of labeling retainer links. The next best thing we can do for now is use std::shared_ptr for InspectedContext and keep an instance on the stack every time we can potentially transition into user JS. [email protected] Fixed: 486927780 Change-Id: I5e4921521a24cc3cd53ffb6cb5b6b6f9d98490e2 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7613210 Auto-Submit: Simon Zünd <[email protected]> Reviewed-by: Benedikt Meurer <[email protected]> Commit-Queue: Simon Zünd <[email protected]> Commit-Queue: Benedikt Meurer <[email protected]> Cr-Commit-Position: refs/heads/main@{#105489} * chore: cherry-pick 2d9ff4098967 from v8 Merged: [maglev] Avoid eliding Smi checks too aggressively (cherry picked from commit 433b2912c5cb94ed0979c8284e96e4d08416b620) Bug: 491884710 Change-Id: Id73c522c6f55cb05167f436c2ee7f60e0db71840 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7673820 Reviewed-by: Leszek Swirski <[email protected]> Commit-Queue: Leszek Swirski <[email protected]> Auto-Submit: Darius Mercadier <[email protected]> Cr-Commit-Position: refs/branch-heads/14.6@{#45} Cr-Branched-From: e04c3a1a2543bdbee7beac8846c9cbe8f657636f-refs/heads/14.6.202@{#1} Cr-Branched-From: 3b0b01e6594ec362369dc16f069012a81748c8ba-refs/heads/main@{#105132} * chore: cherry-pick f297f82fea96 from v8 Merged: [compiler][arm64] Force explicit zero-extension of load index This is the merge-commit for: 1) [arm64][compiler] Always emit truncation to word32 cherry picked from commit 522e74a35cf4e53c3708ea396c299bfbb29d8489 2) [compiler][arm64] Reenable implicit truncation and force explicit zero-extension of load/store index cherry picked from commit 4ef5cc27aa50b4a7e3096bbbffaf5058a811a2a9 Bug: 496301615 Change-Id: I3e5e13a90ad0a43768c9cd46a7ebd99d0f6a4e11 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7715044 Commit-Queue: Matthias Liedtke <[email protected]> Commit-Queue: Darius Mercadier <[email protected]> Reviewed-by: Darius Mercadier <[email protected]> Auto-Submit: Matthias Liedtke <[email protected]> Cr-Commit-Position: refs/branch-heads/14.6@{#63} Cr-Branched-From: e04c3a1a2543bdbee7beac8846c9cbe8f657636f-refs/heads/14.6.202@{#1} Cr-Branched-From: 3b0b01e6594ec362369dc16f069012a81748c8ba-refs/heads/main@{#105132} * chore: cherry-pick 021c5b193bd4 from v8 Merged: [maglev] Account for phi smi type widening in BuildCheckHeapObject Bug: 495679730 (cherry picked from commit c1e78b455e3224e286914b5ac241fbea064cb51d) Change-Id: I77d6f184af8d62a0dbb643c6f34d4a3530b32b63 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7715042 Auto-Submit: Darius Mercadier <[email protected]> Reviewed-by: Leszek Swirski <[email protected]> Commit-Queue: Leszek Swirski <[email protected]> Cr-Commit-Position: refs/branch-heads/14.6@{#65} Cr-Branched-From: e04c3a1a2543bdbee7beac8846c9cbe8f657636f-refs/heads/14.6.202@{#1} Cr-Branched-From: 3b0b01e6594ec362369dc16f069012a81748c8ba-refs/heads/main@{#105132}
API to control the cache of each request.Provide information of from where the request is made (not sure if it's possible).