creating a custom browser plugin image

Bert Freudenberg bert at freudenbergs.de
Sun Jul 15 11:00:23 UTC 2007


Looks like the image tried to access 'http://test.st/'.

The most compatible solution is to add a BASE tag with the absolute  
URL ending in a slash, which is concatenated with the SRC url (see  
ProjectLauncher>>startUpAfterLogin and  
CodeLoader>>createRequestFor:in:).

You can try to add APISUPPORTED="TRUE" which will cause the image to  
try fetching the (relative) SRC through the browser. That may or may  
not work depending on which browser is used.

The problem is that a browser plugin cannot find out the base URL of  
the page it is embedded in, so it cannot resolve relative URLs on its  
own. The only way to fetch relative URLs is by going through the  
browser API. Which was unreliable for years, hence at squeakland the  
APISUPPORTED tag was generated on the server side by a script that  
used the Browser agent string to determine if the API is supported or  
not.

- Bert -

On Jul 15, 2007, at 12:37 , Hilaire Fernandes wrote:

> I try to use a 3.9 image for the browser plugin image.
> I have checked about readDocumentAtStartup preference and  
> "AutoStart installedLaunchers".
>
> The image appears in the browser ok.
>
> If add a src="test.st" in the html as:
>
> <head>
> <title>Test de plugin web Squeak</title>
> </head>
> <body>
> <embed
> 	type="application/x-squeak-source"
> 	src ="test.st"
> 	align="center"
> 	width="700"
> 	height="500">
> </embed>
> </body>
> </html>
>
> With test.st as:
> IFIDbSession default. IFIModels new.
> moment := IFIModels schools anyOne learners anyOne  
> pedagogicalMoments anyOne.
> view := (moment exerciceViewAtStart beSticky position: 0 at 0)  
> openInWorld.
>
> I got a strange error, see attached log and the test.st is not  
> filed in.
>
> If I use this same image and drop the test.st into it, it works fine.
> So it may look like a security check, but I cannot find it.
>
> Thanks
>
> Hilaire
> MessageNotUnderstood: UndefinedObject>>domain
> 15 July 2007 12:30:33 pm
>
> VM: unix - a SmalltalkImage
> Image: Squeak3.9 [latest update: #7068]
>
> SecurityManager state:
> Restricted: false
> FileAccess: true
> SocketAccess: true
> Working Dir /home/hilaire/.npsqueak
> Trusted Dir /home/hilaire/.npsqueak/secure
> Untrusted Dir /home/hilaire/.npsqueak/My Squeak
>
> UndefinedObject(Object)>>doesNotUnderstand: #domain
> 	Receiver: nil
> 	Arguments and temporary variables:
> 		t1: 	domain
> 	Receiver's instance variables:
> nil
>
> UndefinedObject>>DoIt
> 	Receiver: nil
> 	Arguments and temporary variables:
>
> 	Receiver's instance variables:
> nil
>
> Compiler>>evaluate:in:to:notifying:ifFail:logged:
> 	Receiver: a Compiler
> 	Arguments and temporary variables:
> 		t1: 	'Non .ST domain'
> 		t2: 	nil
> 		t3: 	nil
> 		t4: 	nil
> 		t5: 	[] in Compiler class>>evaluate:for:notifying:logged: {[^ nil]}
> 		t6: 	true
> 		t7: 	DoIt
> 	Non.
> 	^ ST domain
> 		t8: 	a CompiledMethod (534)
> 		t9: 	nil
> 		t10: 	nil
> 		t11: 	nil
> 		t12: 	nil
> 	Receiver's instance variables:
> 		sourceStream: 	a ReadStream 'Non .ST domain'
> 		requestor: 	nil
> 		class: 	UndefinedObject
> 		category: 	nil
> 		context: 	nil
> 		parserClass: 	Parser
>
> Compiler class>>evaluate:for:notifying:logged:
> 	Receiver: Compiler
> 	Arguments and temporary variables:
> 		t1: 	'Non .ST domain'
> 		t2: 	nil
> 		t3: 	nil
> 		t4: 	true
> 	Receiver's instance variables:
> 		superclass: 	Object
> 		methodDict: 	a MethodDictionary 
> (#compile:in:classified:notifying:ifFail:->a Comp...etc...
> 		format: 	142
> 		instanceVariables: 	#('sourceStream' 'requestor' 'class'  
> 'category' 'context' 'p...etc...
> 		organization: 	('error handling' notify: notify:at:)
> ('public access' compile:in...etc...
> 		subclasses: 	nil
> 		name: 	#Compiler
> 		classPool: 	a Dictionary()
> 		sharedPools: 	nil
> 		environment: 	a SystemDictionary(lots of globals)
> 		category: 	#'Compiler-Kernel'
> 		traitComposition: 	nil
> 		localSelectors: 	nil
>
>
> --- The full stack ---
> UndefinedObject(Object)>>doesNotUnderstand: #domain
> UndefinedObject>>DoIt
> Compiler>>evaluate:in:to:notifying:ifFail:logged:
> Compiler class>>evaluate:for:notifying:logged:
>  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Compiler class>>evaluate:for:logged:
> Compiler class>>evaluate:logged:
> [] in RWBinaryOrTextStream(PositionableStream)>>fileInAnnouncing:  
> {[t2 := (self peekFor: $!)     ifTrue: [(Compiler evaluate: self  
> nextChunk lo...]}
> BlockContext>>on:do:
> [] in RWBinaryOrTextStream(PositionableStream)>>fileInAnnouncing:  
> {[:t4 |  [self atEnd]   whileFalse: [t4 value: self position.     
> self skipSep...]}
> [] in ProgressInitiationException>>defaultMorphicAction {[t1 :=  
> workBlock value: t2]}
> BlockContext>>ensure:
> ProgressInitiationException>>defaultMorphicAction
> ProgressInitiationException>>defaultAction
> UndefinedObject>>handleSignal:
> ProgressInitiationException(Exception)>>signal
> ProgressInitiationException>>display:at:from:to:during:
> ProgressInitiationException class>>display:at:from:to:during:
> ByteString(String)>>displayProgressAt:from:to:during:
> RWBinaryOrTextStream(PositionableStream)>>fileInAnnouncing:
> RWBinaryOrTextStream(PositionableStream)>>fileIn
> CodeLoader>>installSourceFile:
> [] in CodeLoader>>installSourceFiles {[:t1 | self  
> installSourceFile: t1 contentStream]}
> Array(SequenceableCollection)>>do:
> CodeLoader>>installSourceFiles
> ProjectLauncher>>startUpAfterLogin
> ProjectLauncher>>startUp
> [] in AutoStart class>>startUp: {[t4 startUp]}
> WorldState>>runStepMethodsIn:
> PasteUpMorph>>runStepMethods
> WorldState>>doOneCycleNowFor:
> WorldState>>doOneCycleFor:
> PasteUpMorph>>doOneCycle
> [] in Project class>>spawnNewProcess {[[World doOneCycle.   
> Processor yield.  false] whileFalse.  nil]}
> [] in BlockContext>>newProcess {[self value.  Processor  
> terminateActive]}
>





More information about the Squeak-dev mailing list