mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
fix: prevent Nepal media from opening external browsers in Pinokio
This commit is contained in:
1 parent
81b82da056
commit
94f83c59de
4 files changed
+70
-1
No files matched your search
@@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
- Keep Nepal provider media inside the Pinokio compatibility boundary: use
|
||||||
|
source-linked fallback cards instead of automatic embeds or hidden preloads
|
||||||
|
that launch an external browser. Ordinary browsers retain embedded playback.
|
||||||
|
|
||||||
- Extract a portable Director shot runner and connect existing scene playback to
|
- Extract a portable Director shot runner and connect existing scene playback to
|
||||||
it. Preserve authored content, project files, camera/layer behavior and source
|
it. Preserve authored content, project files, camera/layer behavior and source
|
||||||
attribution; document the planned timeline, scene-file and data-pack boundaries.
|
attribution; document the planned timeline, scene-file and data-pack boundaries.
|
||||||
|
|||||||
@@ -11,6 +11,14 @@ Search framing and annotations request semantic map features from an explicit so
|
|||||||
|
|
||||||
Nepal media preloads survive repeated camera-flight updates, but Stop, event disable and replacement remove abandoned frames and revoke pending Facebook sessions. Fallback evidence-card clicks respect the shared drawing-tool pointer lease.
|
Nepal media preloads survive repeated camera-flight updates, but Stop, event disable and replacement remove abandoned frames and revoke pending Facebook sessions. Fallback evidence-card clicks respect the shared drawing-tool pointer lease.
|
||||||
|
|
||||||
|
In the Pinokio browser shell, Nepal provider embeds and hidden preloads are
|
||||||
|
disabled before creating frames or loading provider SDKs, because the shell can
|
||||||
|
redirect iframe navigation to an external browser. Existing source-linked cards
|
||||||
|
remain available, and Open Original is an explicit action. Optional approved
|
||||||
|
local clips still use the existing fallback; the public pack bundles no witness
|
||||||
|
clips. Chrome and Safari retain embeds even when visiting a Pinokio-launched
|
||||||
|
server. This compatibility fallback does not repair Pinokio's navigation handler.
|
||||||
|
|
||||||
Nepal flood lines classify the active terrain or photoreal surface, and the surge marker follows that surface. Geographic route coordinates are unchanged; dynamic lines do not rely on unsupported depth-failure materials. Later media-only shots keep their completed source-path history throughout arrival and card reveal.
|
Nepal flood lines classify the active terrain or photoreal surface, and the surge marker follows that surface. Geographic route coordinates are unchanged; dynamic lines do not rely on unsupported depth-failure materials. Later media-only shots keep their completed source-path history throughout arrival and card reveal.
|
||||||
|
|
||||||
Scene Stop, replacement, seek, and teardown revoke the Upper Valley locator's delayed camera approach and orbit while preserving its visible callout. A revoked timer or camera callback cannot start another flight or interfere with a newer shot.
|
Scene Stop, replacement, seek, and teardown revoke the Upper Valley locator's delayed camera approach and orbit while preserving its visible callout. A revoked timer or camera callback cannot start another flight or interfere with a newer shot.
|
||||||
|
|||||||
@@ -595,7 +595,13 @@ export function createBhoteKoshiEmbeddedMedia({
|
|||||||
facebookLoader = loadFacebookSdk,
|
facebookLoader = loadFacebookSdk,
|
||||||
youtubeLoader = loadYouTubeApi,
|
youtubeLoader = loadYouTubeApi,
|
||||||
} = {}) {
|
} = {}) {
|
||||||
if (!documentRef?.createElement || !viewer) {
|
// Pinokio externalizes HTTPS iframe navigation, including hidden preloads.
|
||||||
|
// Use the existing source-card/local-clip fallback before allocating provider
|
||||||
|
// resources. Browsers visiting the same Pinokio-launched server keep embeds.
|
||||||
|
const pinokioShell = /(?:^|\s)Pinokio\/[^\s]+/i.test(
|
||||||
|
globalRef.navigator?.userAgent || '',
|
||||||
|
);
|
||||||
|
if (pinokioShell || !documentRef?.createElement || !viewer) {
|
||||||
return {
|
return {
|
||||||
warm: () => false,
|
warm: () => false,
|
||||||
show: () => false,
|
show: () => false,
|
||||||
|
|||||||
@@ -10,6 +10,57 @@ import {
|
|||||||
resolveEmbeddedMediaSource,
|
resolveEmbeddedMediaSource,
|
||||||
} from './bhoteKoshiEmbeddedMedia.js';
|
} from './bhoteKoshiEmbeddedMedia.js';
|
||||||
|
|
||||||
|
test('Pinokio fallback never creates provider DOM or loads SDKs', async () => {
|
||||||
|
const unexpected = () => { throw new Error('Provider resource allocated in Pinokio'); };
|
||||||
|
const media = createBhoteKoshiEmbeddedMedia({
|
||||||
|
viewer: {},
|
||||||
|
documentRef: { createElement: unexpected },
|
||||||
|
globalRef: {
|
||||||
|
navigator: { userAgent: 'Mozilla/5.0 Chrome/140.0.0.0 Safari/537.36 Pinokio/8.0.40' },
|
||||||
|
setTimeout: unexpected,
|
||||||
|
requestAnimationFrame: unexpected,
|
||||||
|
},
|
||||||
|
facebookLoader: unexpected,
|
||||||
|
youtubeLoader: unexpected,
|
||||||
|
xLoader: unexpected,
|
||||||
|
});
|
||||||
|
for (const sourceUrl of [
|
||||||
|
'https://www.youtube.com/watch?v=abcdefghijk',
|
||||||
|
'https://www.facebook.com/watch/?v=123456789',
|
||||||
|
'https://x.com/example/status/123456789',
|
||||||
|
]) {
|
||||||
|
const options = { observation: { media: { sourceUrl } }, autoplay: true };
|
||||||
|
assert.equal(media.warm(options), false, 'no hidden preload');
|
||||||
|
assert.equal(media.show(options), false, 'retain the existing fallback card');
|
||||||
|
assert.equal(media.play(), false);
|
||||||
|
assert.equal(media.pause(), false);
|
||||||
|
media.hide();
|
||||||
|
}
|
||||||
|
media.destroy();
|
||||||
|
media.hide();
|
||||||
|
await Promise.resolve();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('ordinary browsers retain real preloads on the same launcher URL', () => {
|
||||||
|
for (const userAgent of [
|
||||||
|
'Mozilla/5.0 Chrome/140.0.0.0 Safari/537.36',
|
||||||
|
'Mozilla/5.0 Version/18.0 Safari/605.1.15',
|
||||||
|
'Mozilla/5.0 Electron/38.0.0',
|
||||||
|
'',
|
||||||
|
]) {
|
||||||
|
const { media, root } = preloadFixture({ globalRef: {
|
||||||
|
navigator: { userAgent }, location: { href: 'http://127.0.0.1:42003/' },
|
||||||
|
} });
|
||||||
|
assert.equal(media.warm({ observation: { media: {
|
||||||
|
sourceUrl: 'https://www.youtube.com/watch?v=abcdefghijk',
|
||||||
|
} } }), true);
|
||||||
|
assert.equal(root.children.length, 1);
|
||||||
|
media.pause();
|
||||||
|
assert.equal(root.children.length, 0);
|
||||||
|
media.destroy();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function trimmedPlaybackFixture() {
|
function trimmedPlaybackFixture() {
|
||||||
let now = 0;
|
let now = 0;
|
||||||
let nextId = 0;
|
let nextId = 0;
|
||||||
|
|||||||
Reference in new issue
Block a user