experiments in a post-browser web
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

add relative path unfuck, need to file Electron bug

+25 -9
+2 -2
app/windows.js
··· 19 19 // Set modal flag to true 20 20 params.modal = true; 21 21 22 - console.log('Opening modal window with params:', params); 22 + //console.log('Opening modal window with params:', params); 23 23 24 24 // Always use the IPC API 25 25 if (api.window && api.window.open) { ··· 39 39 * @returns {Promise<Object>} - Promise resolving to an object with methods to interact with the window 40 40 */ 41 41 const createWindow = async (address, params = {}) => { 42 - console.log('Creating window with params:', params); 42 + //console.log('Creating window with params:', params); 43 43 44 44 let windowId; 45 45
+23 -7
index.js
··· 246 246 247 247 return { 248 248 publish: (source, scope, topic, msg) => { 249 - console.log('ps.pub', topic); 249 + //console.log('ps.pub', topic); 250 250 251 251 if (topics.has(topic)) { 252 252 ··· 261 261 } 262 262 }, 263 263 subscribe: (source, scope, topic, cb) => { 264 - console.log('ps.sub', source, scope, topic); 264 + //console.log('ps.sub', source, scope, topic); 265 265 266 266 if (!topics.has(topic)) { 267 267 topics.set(topic, new Map([ [source, cb] ])); ··· 323 323 324 324 let relativePath = pathname; 325 325 326 - // Ugh 326 + // Ugh, handle node_modules paths 327 + // does this even work in packaged build? 327 328 const isNode = pathname.indexOf('node_modules') > -1; 329 + 328 330 if (!isNode) { 329 331 relativePath = path.join(host, pathname); 330 332 331 333 // if not core, prepend core path 332 334 if (host != APP_CORE_PATH) { 333 335 relativePath = path.join(APP_CORE_PATH, relativePath); 336 + } 337 + 338 + // Ugh, desparate attempt to handle `../` paths 339 + // FIXME: Complete and utter trash 340 + try { 341 + const stat = fs.statSync(relativePath) 342 + } 343 + catch(ex) { 344 + // file does not exist 345 + // but maybe it's in parent dir 346 + // b/c what the fuck is happening w/ custom 347 + // protocols and parent-relative path resolution?! 348 + const parts = relativePath.split(path.sep); 349 + relativePath = parts.toSpliced(1, 1).join(path.sep); 334 350 } 335 351 } 336 352 ··· 1036 1052 }; 1037 1053 1038 1054 const closeOrHideWindow = id => { 1039 - console.log('CLOSE OR HIDE WINDOW CALLED FOR ID:', id); 1055 + //console.log('CLOSE OR HIDE WINDOW CALLED FOR ID:', id); 1040 1056 1041 1057 try { 1042 1058 const win = BrowserWindow.fromId(id); ··· 1046 1062 } 1047 1063 1048 1064 const entry = windowManager.getWindow(id); 1049 - console.log('Window entry from manager:', entry); 1065 + //console.log('Window entry from manager:', entry); 1050 1066 1051 1067 if (!entry) { 1052 1068 console.log('Window not found in window manager, closing directly'); ··· 1055 1071 } 1056 1072 1057 1073 const params = entry.params; 1058 - console.log('Window parameters:', params); 1074 + //console.log('Window parameters:', params); 1059 1075 1060 1076 // Special case for settings window - always close it on ESC 1061 1077 if (params.address === settingsAddress) { ··· 1066 1082 // Check if window should be hidden rather than closed 1067 1083 // Either keepLive or modal parameter can trigger hiding behavior 1068 1084 else if (params.keepLive === true || params.modal === true) { 1069 - console.log(`HIDING window ${id} (${params.address}) - modal: ${params.modal}, keepLive: ${params.keepLive}`); 1085 + //console.log(`HIDING window ${id} (${params.address}) - modal: ${params.modal}, keepLive: ${params.keepLive}`); 1070 1086 win.hide(); 1071 1087 } else { 1072 1088 // close any open windows this window opened