profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/lvsti/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

lvsti/CoreMediaIO-DAL-Example 129

Apple's CoreMediaIO DAL plugin example - modernized

lvsti/CEF.swift 66

Swift bindings for the Chromium Embedded Framework

lvsti/Bridgecraft 58

Generate Swift interface for ObjC bridging headers

lvsti/Cameo 56

CMIO DAL plugin explorer

lvsti/CMIOKit 32

Developer-friendly Swift wrapper around the CoreMediaIO C APIs

lvsti/mapscale 21

Map scale view extension for the built-in iOS MKMapView

lvsti/AirCopy 14

AirDrop for your clipboard

lvsti/MockSix 12

Mocking microframework for Swift

lvsti/Ilion 6

Localization helper tool for macOS

lvsti/hs264 5

H.264 decoder in Haskell

startedlvsti/Bridgecraft

started time in 2 days

startedlvsti/Cameo

started time in 3 days

issue openedlvsti/CEF.swift

Try to load local file with Request Interception

Hi, I try to load a local html file with Request Interception but the browser remains desperately empty.

I have created a CEFRequestHandler :

class TestRequestHandler: CEFRequestHandler {
    func onGetResourceRequestHandler(browser: CEFBrowser, frame: CEFFrame, request: CEFRequest, isNavigation: Bool, isDownload: Bool, initiator: String, disableDefault: inout Bool) -> CEFResourceRequestHandler? {
        disableDefault = true
        return TestResourceRequestHandler()
    }
}

a CEFResourceRequestHandler :

class TestResourceRequestHandler: CEFResourceRequestHandler {
    func cookieAccessFilter(browser: CEFBrowser?, frame: CEFFrame?, request: CEFRequest) -> CEFCookieAccessFilter? {
        return nil
    }
    
    func resourceHandler(browser: CEFBrowser?, frame: CEFFrame?, request: CEFRequest) -> CEFResourceHandler? {
        return TestResourceHandler()
    }

    func onResourceLoadComplete(browser: CEFBrowser?, frame: CEFFrame?, request: CEFRequest, response: CEFResponse, status: CEFURLRequestStatus, contentLength: Int64) {
        print("Load Complete")
    }
}

and a CEFResourceHandler :

class TestResourceHandler: CEFResourceHandler {
    var fileData:Data?
    var bytesDone:Int = 0
    
    func onOpenResponseStream(request: CEFRequest, callback: CEFCallback) -> CEFOnOpenResponseStreamAction {
        let fileManager = FileManager.default
        var filePath = Bundle.main.resourcePath!
        let url = request.url!.absoluteString
        let index = url.index(url.startIndex, offsetBy: "http://localhost".characters.count)
        
        filePath += url.substring(from:index)
        if fileManager.fileExists(atPath: filePath) {
            // Open the file
            let file = FileHandle(forReadingAtPath: filePath)
            fileData = file?.readDataToEndOfFile()
            // Close the file
            file?.closeFile()
        } else {
            print("File not found : " + filePath)
        }
        return .handle
    }

    
    func onGetResponseHeaders(response: CEFResponse) -> CEFOnGetResponseHeadersAction {
        if fileData != nil{
            response.status = 200;
            response.statusText = "OK";
            return .continueWithResponseLength(UInt64(fileData!.count))
        }
        return .abort
    }

    
    func onReadResponseData(buffer: UnsafeMutableRawPointer, bufferLength: Int, callback: CEFResourceReadCallback) -> CEFOnReadResponseDataAction {
        let nsData = fileData! as NSData
        let chunkSize = min(fileData!.count - bytesDone, bufferLength)
        buffer.copyMemory(from: nsData.bytes.advanced(by: bytesDone), byteCount: chunkSize)
        bytesDone += chunkSize
        return .read(chunkSize)
    }
    
}

The onResourceLoadComplete is called but nothing is displayed.

I probably forgot something but what ? Do you have a sample code with request intercetion ?

Thank you in advance

created time in 13 days

issue closedlvsti/CEF.swift

CEFResourceHandler does not seem to work as expected

Hi, I have a problem with CEFResourceHandler in branch cef_4280. The bufferLength parameter is not set correctly for onReadResponseData.

class TestResourceHandler: CEFResourceHandler { var fileData:Data? var bytesDone:Int = 0

func onOpenResponseStream(request: CEFRequest, callback: CEFCallback) -> CEFOnOpenResponseStreamAction {
    let fileManager = FileManager.default
    var filePath = Bundle.main.resourcePath!
    let url = request.url!.absoluteString
    let index = url.index(url.startIndex, offsetBy: "http://localhost".characters.count)
    
    filePath += url.substring(from:index)
    if fileManager.fileExists(atPath: filePath) {
        // Open the file
        let file = FileHandle(forReadingAtPath: filePath)
        fileData = file?.readDataToEndOfFile()
        // Close the file
        file?.closeFile()
    } else {
        print("File not found : " + filePath)
    }
    return .handle
}


func onGetResponseHeaders(response: CEFResponse) -> CEFOnGetResponseHeadersAction {
    if fileData != nil{
        response.status = 200;
        response.statusText = "OK";
        return .continueWithResponseLength(UInt64(fileData!.count)) // Here value = 96
    }
    return .abort
}


func onReadResponseData(buffer: UnsafeMutableRawPointer, bufferLength: Int, callback: CEFResourceReadCallback) -> CEFOnReadResponseDataAction {
   // Here bufferLength = 65536 expected -> 96
    let nsData = fileData! as NSData
    buffer.copyMemory(from: nsData.bytes.advanced(by: bytesDone), byteCount: bufferLength)
    bytesDone += bufferLength
    if bytesDone == UInt64(fileData!.count) {
        return .complete
    } else {
        return .read(bufferLength)
    }
}

}

Did I forget something? Do you have an example of use?

Thanks

closed time in 14 days

ebaujard

issue commentlvsti/CEF.swift

CEFResourceHandler does not seem to work as expected

Hi, Thank you for your prompt response. I'm migrating from CEF 2924 to CEF 4280, it's disturbing to have the same parameter in these 2 versions with a different purpose.

ebaujard

comment created time in 14 days

startedlvsti/CoreMediaIO-DAL-Example

started time in 14 days

issue openedlvsti/CEF.swift

CEFResourceHandler does not seem to work as expected

Hi, I have a problem with CEFResourceHandler in branch cef_4280. The bufferLength parameter is not set correctly for onReadResponseData.

class TestResourceHandler: CEFResourceHandler { var fileData:Data? var bytesDone:Int = 0

func onOpenResponseStream(request: CEFRequest, callback: CEFCallback) -> CEFOnOpenResponseStreamAction {
    let fileManager = FileManager.default
    var filePath = Bundle.main.resourcePath!
    let url = request.url!.absoluteString
    let index = url.index(url.startIndex, offsetBy: "http://localhost".characters.count)
    
    filePath += url.substring(from:index)
    if fileManager.fileExists(atPath: filePath) {
        // Open the file
        let file = FileHandle(forReadingAtPath: filePath)
        fileData = file?.readDataToEndOfFile()
        // Close the file
        file?.closeFile()
    } else {
        print("File not found : " + filePath)
    }
    return .handle
}


func onGetResponseHeaders(response: CEFResponse) -> CEFOnGetResponseHeadersAction {
    if fileData != nil{
        response.status = 200;
        response.statusText = "OK";
        return .continueWithResponseLength(UInt64(fileData!.count)) // Here value = 96
    }
    return .abort
}


func onReadResponseData(buffer: UnsafeMutableRawPointer, bufferLength: Int, callback: CEFResourceReadCallback) -> CEFOnReadResponseDataAction {
   // Here bufferLength = 65536 expected -> 96
    let nsData = fileData! as NSData
    buffer.copyMemory(from: nsData.bytes.advanced(by: bytesDone), byteCount: bufferLength)
    bytesDone += bufferLength
    if bytesDone == UInt64(fileData!.count) {
        return .complete
    } else {
        return .read(bufferLength)
    }
}

}

Did I forget something? Do you have an example of use?

Thanks

created time in 18 days

issue openedlvsti/SevenZip

不支持分卷如:.z01 .z02

created time in 21 days

startedlvsti/SevenZip

started time in 21 days

fork goodapp/SevenZip

ObjC wrapper around the 7zip/LZMA SDK

fork in 21 days

startedlvsti/Cameo

started time in a month

startedlvsti/CMIOKit

started time in a month

startedlvsti/CoreMediaIO-DAL-Example

started time in a month

startedlvsti/CMIOKit

started time in a month

startedlvsti/Cameo

started time in a month

startedlvsti/CoreMediaIO-DAL-Example

started time in a month

startedlvsti/Cameo

started time in a month

startedlvsti/CoreMediaIO-DAL-Example

started time in a month

startedlvsti/CEF.swift

started time in 2 months

startedlvsti/CoreMediaIO-DAL-Example

started time in 2 months

startedlvsti/Cameo

started time in 2 months

fork superworldapp/CoreMediaIO-DAL-Example

Apple's CoreMediaIO DAL plugin example - modernized

fork in 2 months

startedlvsti/CoreMediaIO-DAL-Example

started time in 2 months

issue closedlvsti/Audit

Why Break points are not hitting?

Hello, I tried to debug a plugin using Audit. it does not work? Can't I debug this like a core media IO DAL video plugin?

closed time in 2 months

Raj123456788

issue commentlvsti/Audit

Why Break points are not hitting?

This is the only way for now https://github.com/kyleneideck/BackgroundMusic/blob/master/DEVELOPING.md#building-and-debugging

Raj123456788

comment created time in 2 months

startedlvsti/CoreMediaIO-DAL-Example

started time in 2 months

startedlvsti/CMIOKit

started time in 2 months

startedlvsti/Cameo

started time in 2 months

startedlvsti/CoreMediaIO-DAL-Example

started time in 2 months

startedlvsti/CoreMediaIO-DAL-Example

started time in 2 months