我正在制作一个Google chrome扩展程序,该扩展程序显示特定情况下的通知,当单击通知时,我需要使用html文件打开一个新标签,该文件需要在api调用后进行编辑。我试图做到这一点的方法是在background.js中注入一个内容脚本,但是我无法使其正常工作。有没有更好/更容易的方法?
Background.js代码的一部分
Dim vComponents As Variant
Dim vComp As Variant
Dim Part As Object
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
vComponents = Part.GetComponents(True)
For Each vComp In vComponents
Set swComp = vComp
If InStr(swComp.Name2, "_ST_") > 0 Then swComp.Select4 True, Nothing, False
Next
Set swSelMgr = Part.SelectionManager
Set swSelComp = swSelMgr.GetSelectedObjectsComponent4(1, -1)
Set swReferenceModel = swSelComp.GetModelDoc2
originalStello = swReferenceModel.Parameter("D7@Schizzo1").Value // this is where I am hard coding the name